]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: fix set_format altsetting sanity check
authorJohan Hovold <johan@kernel.org>
Fri, 20 Dec 2019 09:31:34 +0000 (10:31 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 20 Dec 2019 10:31:46 +0000 (11:31 +0100)
commitbb7e1f18d6f9a5fa300b0e0b091c213a0014248f
tree1095e51d158b7daa9faa3bc6080d22feff6ffd03
parenta32f1b3a7af660266c176b574a6d0942dded50ed
ALSA: usb-audio: fix set_format altsetting sanity check

Make sure to check the return value of usb_altnum_to_altsetting() to
avoid dereferencing a NULL pointer when the requested alternate settings
is missing.

The format altsetting number may come from a quirk table and there does
not seem to be any other validation of it (the corresponding index is
checked however).

Fixes: cb15477310a9 ("ALSA: usb-audio: Avoid superfluous usb_set_interface() calls")
Cc: stable <stable@vger.kernel.org> # 4.18
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191220093134.1248-1-johan@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c