]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls
authorTakashi Iwai <tiwai@suse.de>
Tue, 6 Apr 2021 11:35:34 +0000 (13:35 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 7 Apr 2021 09:59:56 +0000 (11:59 +0200)
commit51425fb28e40c953018868cd9328c5a3faf0f16f
tree7a3e5262d0f82e23b3b8a73f4c7cb4ff6eab8ec6
parentf3bf824f2e2983014eb58b6cc8375bba29a79ec7
ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls

There are a few calls of usb_driver_claim_interface() but all of those
miss the proper error checks, as reported by Coverity.  This patch
adds those missing checks.

Along with it, replace the magic pointer with -1 with a constant
USB_AUDIO_IFACE_UNUSED for better readability.

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: ab766c66d81d ("ALSA: usb-audio: claim autodetected PCM interfaces all at once")
Fixes: 63df989f9716 ("ALSA: usb-audio: refactor code")
Link: https://lore.kernel.org/r/202104051059.FB7F3016@keescook
Link: https://lore.kernel.org/r/20210406113534.30455-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c
sound/usb/quirks.c
sound/usb/usbaudio.h