From: coverity-bot <keescook@chromium.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Daniel Mack <daniel@caiaq.de>,
Clemens Ladisch <clemens@ladisch.de>,
"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
linux-next@vger.kernel.org
Subject: Coverity: ALSA: usb-audio: Error handling issues
Date: Mon, 5 Apr 2021 11:02:16 -0700 [thread overview]
Message-ID: <202104051059.FB7F3016@keescook> (raw)
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20210401 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:
Fri Mar 5 08:17:14 2010 +0100
e5779998bf8b ("ALSA: usb-audio: refactor code")
Thu Jun 27 21:59:49 2013 +0200
b1ce7ba619d9 ("ALSA: usb-audio: claim autodetected PCM interfaces all at once")
Coverity reported the following:
*** CID 1475943: Error handling issues (CHECKED_RETURN)
/sound/usb/quirks.c: 430 in create_autodetect_quirks()
424 get_iface_desc(iface->altsetting)->bInterfaceClass !=
425 USB_CLASS_VENDOR_SPEC)
426 continue;
427
428 err = create_autodetect_quirk(chip, iface, driver);
429 if (err >= 0)
vvv CID 1475943: Error handling issues (CHECKED_RETURN)
vvv Calling "usb_driver_claim_interface" without checking return value (as is done elsewhere 16 out of 20 times).
430 usb_driver_claim_interface(driver, iface, (void *)-1L);
431 }
432
433 return 0;
434 }
435
*** CID 1475944: Error handling issues (CHECKED_RETURN)
/sound/usb/card.c: 206 in snd_usb_create_stream()
200 dev_err(&dev->dev, "low speed audio streaming not supported\n");
201 return -EINVAL;
202 }
203
204 if (! snd_usb_parse_audio_interface(chip, interface)) {
205 usb_set_interface(dev, interface, 0); /* reset the current interface */
vvv CID 1475944: Error handling issues (CHECKED_RETURN)
vvv Calling "usb_driver_claim_interface" without checking return value (as is done elsewhere 16 out of 20 times).
206 usb_driver_claim_interface(&usb_audio_driver, iface, (void *)-1L);
207 }
208
209 return 0;
210 }
211
*** CID 1475945: Error handling issues (CHECKED_RETURN)
/sound/usb/quirks.c: 59 in create_composite_quirk()
53 for (quirk = quirk_comp->data; quirk->ifnum >= 0; ++quirk) {
54 iface = usb_ifnum_to_if(chip->dev, quirk->ifnum);
55 if (!iface)
56 continue;
57 if (quirk->ifnum != probed_ifnum &&
58 !usb_interface_claimed(iface))
vvv CID 1475945: Error handling issues (CHECKED_RETURN)
vvv Calling "usb_driver_claim_interface" without checking return value (as is done elsewhere 16 out of 20 times).
59 usb_driver_claim_interface(driver, iface, (void *)-1L);
60 }
61
62 return 0;
63 }
64
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: 1475943 ("Error handling issues")
Addresses-Coverity-ID: 1475944 ("Error handling issues")
Addresses-Coverity-ID: 1475945 ("Error handling issues")
Fixes: b1ce7ba619d9 ("ALSA: usb-audio: claim autodetected PCM interfaces all at once")
Fixes: e5779998bf8b ("ALSA: usb-audio: refactor code")
Thanks for your attention!
--
Coverity-bot
reply other threads:[~2021-04-05 18:02 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=202104051059.FB7F3016@keescook \
--to=keescook@chromium.org \
--cc=clemens@ladisch.de \
--cc=daniel@caiaq.de \
--cc=gustavo@embeddedor.com \
--cc=linux-next@vger.kernel.org \
--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).