[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220701072625.GQ11460@kadam>
Date: Fri, 1 Jul 2022 10:26:25 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Ricardo Ribalda <ribalda@...omium.org>
Cc: kbuild@...ts.01.org,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-kernel@...r.kernel.org, tfiga@...omium.org,
senozhatsky@...omium.org, yunkec@...gle.com, lkp@...el.com,
kbuild-all@...ts.01.org, linux-media@...r.kernel.org
Subject: Re: [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
Powered by blists - more mailing lists