From: coverity-bot <keescook@chromium.org>
To: Jaroslav Kysela <perex@perex.cz>
Cc: alsa-devel@alsa-project.org, "Dan Carpenter" <error27@gmail.com>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
"Takashi Iwai" <tiwai@suse.de>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
"Takashi Iwai" <tiwai@suse.com>,
"chihhao chen" <chihhao.chen@mediatek.com>,
linux-next@vger.kernel.org, linux-hardening@vger.kernel.org,
"André Kapelrud" <a.kapelrud@gmail.com>,
"Matteo Martelli" <matteomartelli3@gmail.com>,
"Colin Ian King" <colin.i.king@gmail.com>,
"Craig McLure" <craig@mclure.net>
Subject: Coverity: snd_usb_pcm_has_fixed_rate(): Null pointer dereferences
Date: Thu, 12 Jan 2023 14:24:52 -0800 [thread overview]
Message-ID: <202301121424.4A79A485@keescook> (raw)
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20230111 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Mon Jan 9 16:05:21 2023 +0100
291e9da91403 ("ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()")
Coverity reported the following:
*** CID 1530547: Null pointer dereferences (REVERSE_INULL)
sound/usb/pcm.c:166 in snd_usb_pcm_has_fixed_rate()
160 bool snd_usb_pcm_has_fixed_rate(struct snd_usb_substream *subs)
161 {
162 const struct audioformat *fp;
163 struct snd_usb_audio *chip = subs->stream->chip;
164 int rate = -1;
165
vvv CID 1530547: Null pointer dereferences (REVERSE_INULL)
vvv Null-checking "subs" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
166 if (!subs)
167 return false;
168 if (!(chip->quirk_flags & QUIRK_FLAG_FIXED_RATE))
169 return false;
170 list_for_each_entry(fp, &subs->fmt_list, list) {
171 if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1530547 ("Null pointer dereferences")
Fixes: 291e9da91403 ("ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()")
Thanks for your attention!
--
Coverity-bot
reply other threads:[~2023-01-12 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202301121424.4A79A485@keescook \
--to=keescook@chromium.org \
--cc=a.kapelrud@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=chihhao.chen@mediatek.com \
--cc=colin.i.king@gmail.com \
--cc=craig@mclure.net \
--cc=error27@gmail.com \
--cc=gustavo@embeddedor.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=matteomartelli3@gmail.com \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).