[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a779ee26-fe93-47ac-a25c-b842534e0317@suswa.mountain>
Date: Fri, 2 Aug 2024 13:40:48 -0500
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Abhishek Tamboli <abhishektamboli9@...il.com>
Cc: laurent.pinchart@...asonboard.com, dan.scally@...asonboard.com,
gregkh@...uxfoundation.org, skhan@...uxfoundation.org,
rbmarliere@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: uvc: Fix ERR_PTR dereference in uvc_v4l2.c
On Fri, Aug 02, 2024 at 11:32:47PM +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()
>
> Signed-off-by: Abhishek Tamboli <abhishektamboli9@...il.com>
When I reviewed these warnings in 2022, I assumed that the error
checking was left out deliberately because it couldn't fail so I didn't
report these warnings.
Almost all old Smatch warnings are false positives. That doesn't mean
Smatch is bad, it's just how it's going to be when you fix all the real
bugs. In this case, I just decided it was a false positive. It's
possible I was wrong. Other times, I report the bug and the maintainers
say that it's a false positive.
There are some old bugs which are real. Sometimes I report a bug but
the maintainer doesn't see the email because they go on vacation or
something. Or someone sends a patch but it doesn't get merged. Another
thing is that if a bug is over five years old and minor then I might not
bother reporting it. These days kernel developers are very good at
fixing static checker bugs and these kinds of things are pretty rare.
I don't review old warnings in a systematic way. If I fix a bug in a
file, then I'll re-review all the old warnings.
If we decide to merge this code, it needs a Fixes tag.
regards,
dan carpenter
Powered by blists - more mailing lists