Re: [PATCH v2] usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c

From: Abhishek Tamboli
Date: Thu Aug 15 2024 - 05:54:49 EST


On Thu, Aug 15, 2024 at 09:59:35AM +0200, Greg KH wrote:
> On Thu, Aug 15, 2024 at 12:44:16PM +0530, Abhishek Tamboli wrote:
> > Fix potential dereferencing of ERR_PTR() in find_format_by_pix()
> > and uvc_v4l2_enum_format().
> >
> > Fix the following smatch errors:
> >
> > drivers/usb/gadget/function/uvc_v4l2.c:124 find_format_by_pix()
> > error: 'fmtdesc' dereferencing possible ERR_PTR()
> >
> > drivers/usb/gadget/function/uvc_v4l2.c:392 uvc_v4l2_enum_format()
> > error: 'fmtdesc' dereferencing possible ERR_PTR()
> >
> > Also, fix similar issue in uvc_v4l2_try_format() for potential
> > dereferencing of ERR_PTR().
> >
> > Fixes: 588b9e85609b ("usb: gadget: uvc: add v4l2 enumeration api calls")
> > Fixes: e219a712bc06 ("usb: gadget: uvc: add v4l2 try_format api call")
> > Signed-off-by: Abhishek Tamboli <abhishektamboli9@xxxxxxxxx>
> > ---
> > Changes in v2:
> > - Add check for dereferencing of ERR_PTR() in uvc_v4l2_try_format()
>
> You sent 2 copies of this, which is the correct one?
Sorry about that. Actually, I forgot to add the maintainer: Laurent Pinchart
in my first Patch v2 mail.

Regards,
Abhishek