]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:35 +0000 (17:46 -0600)
commit74a040e18ac872c3942435e9936fb045597f4a84
tree287a94422e53430304a21653e272a268e2f639b7
parent9cfaf4aeba0bc23e6def210fdd4c986c4f51f8a5
ALSA: usb-audio: Add error checks for usb_driver_claim_interface() calls

BugLink: https://bugs.launchpad.net/bugs/1929455
[ Upstream commit 5fb45414ae03421255593fd5556aa2d1d82303aa ]

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: b1ce7ba619d9 ("ALSA: usb-audio: claim autodetected PCM interfaces all at once")
Fixes: e5779998bf8b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
sound/usb/card.c
sound/usb/quirks.c
sound/usb/usbaudio.h