From: Dan Carpenter <error27@gmail.com>
To: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Cc: gregkh@linuxfoundation.org, vaibhav.sr@gmail.com,
mgreer@animalcreek.com, johan@kernel.org, elder@kernel.org,
greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH v3 1/2] staging: greybus: audio_codec: fix sscanf return value check
Date: Mon, 15 Jun 2026 10:35:00 +0300 [thread overview]
Message-ID: <ai-rJPFgXHrJ1IEE@stanley.mountain> (raw)
In-Reply-To: <20260614154329.5176-2-abdelnasserhussein11@gmail.com>
On Sun, Jun 14, 2026 at 06:43:28PM +0300, Abdelnasser Hussein wrote:
> Smatch static checker warns:
> drivers/staging/greybus/audio_codec.c:335 gbaudio_module_update()
> warn: sscanf doesn't return error codes
>
> The sscanf() function returns the number of successfully matched input
> items, not a negative error code. Compare the return value directly
> with the expected number of conversions (3) instead of storing it in
> 'ret' and returning it as an error code, which leads to returning
> a positive value on failure.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Closes: https://lore.kernel.org/all/YoOLnDkHgVltyXK7@kili/
>
> Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
There shouldn't be a blank line in the middle of the tags
block.
The closes tag isn't right...
https://lore.kernel.org/all/202103080429.X31wogmF-lkp@intel.com/
Sorry, this stuff is a bit confusing to everyone who is not involved
with the zero day bot. What happens is that for some warnings, they
first send the warning to me and I look it over and decide whether or
not it's valid. In this case, I decided it wasn't valid. Sure, I can
understand why the static checker thinks we're propagating the return
from sscanf() but actually the second else if is always true.
(I haven't actually checked that btw, I'm just assuming that the
second else if is always true. Static analysis is always a best
effort type of thing).
regards,
dan carpenter
next prev parent reply other threads:[~2026-06-15 7:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-14 15:43 [PATCH v3 0/2] staging: greybus: audio: cleanups for gbaudio_module_update Abdelnasser Hussein
2026-06-14 15:43 ` [PATCH v3 1/2] staging: greybus: audio_codec: fix sscanf return value check Abdelnasser Hussein
2026-06-15 7:35 ` Dan Carpenter [this message]
2026-06-14 15:43 ` [PATCH v3 2/2] staging: greybus: audio_codec: remove redundant else-if check Abdelnasser Hussein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ai-rJPFgXHrJ1IEE@stanley.mountain \
--to=error27@gmail.com \
--cc=abdelnasserhussein11@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mgreer@animalcreek.com \
--cc=vaibhav.sr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox