lkml.org 
[lkml]   [2022]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 2/8] media: uvcvideo: Add support for per-device control mapping overrides
On Fri, Jul 01, 2022 at 01:16:23AM +0200, Ricardo Ribalda wrote:
> >
> > "mapping" uninitialized if chain->dev->info->mappings is NULL.
> >
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2457
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2458 /* Process common mappings next. */
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 @2459 mend = mapping + ARRAY_SIZE(uvc_ctrl_mappings);
> > ^^^^^^^
> >
> > 10bdca4191d7a8 drivers/media/usb/uvc/uvc_ctrl.c Ricardo Ribalda 2022-06-17 2460 for (mapping = uvc_ctrl_mappings; mapping < mend; ++mapping) {
> >
> > I'm surprised this made it through testing... Anyway, the easier way to
> > to iterate through an array of structs is just say:
>
> There is already a new version under review that fixes this:
>
> https://patchwork.linuxtv.org/project/linux-media/patch/20220617235610.321917-3-ribalda@chromium.org/
>
>
> >
> > for (i = 0; i < ARRAY_SIZE(uvc_ctrl_mappings); i++) {
> > mapping = &uvc_ctrl_mappings[i];
> >
>
> I agree, and that is what I normally used, but that driver iterate this way...

That's not really an excuse. Imagine you were a lemming and Disney
employees were trying to chase you off a cliff!

>
> Thanks again!
>
> PS: Any idea why the test was triggered 14+ days after the patch was sent?

I don't know how kbuild works. I run Smatch on linux-next so I would
have caught it eventually. Plus the clang people would have caught it.

regards,
dan carpenter

\
 
 \ /
  Last update: 2022-07-01 09:28    [W:0.074 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site