From: Geoffrey D. Bennett Date: Fri, 27 Oct 2023 10:01:21 +0000 (+1030) Subject: ALSA: scarlett2: Add missing check with firmware version control X-Git-Tag: v6.7-rc1~103^2~2^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a5901f27dcf13203e5b342b7e9439314a775bf32;p=users%2Fdwmw2%2Flinux.git ALSA: scarlett2: Add missing check with firmware version control scarlett2_add_firmware_version_ctl() may return an error, but the return value was not being checked. Add the missing check. Signed-off-by: Geoffrey D. Bennett Fixes: 701949cc0128 ("ALSA: scarlett2: Add support for reading firmware version") Link: https://lore.kernel.org/r/ZTuKcXajVnuelBEb@m.b4.vu Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 462a66d485c87..f7c57a2c3028f 100644 --- a/sound/usb/mixer_scarlett2.c +++ b/sound/usb/mixer_scarlett2.c @@ -4424,6 +4424,8 @@ static int snd_scarlett2_controls_create( /* Add firmware version control */ err = scarlett2_add_firmware_version_ctl(mixer); + if (err < 0) + return err; /* Read volume levels and controls from the interface */ err = scarlett2_read_configs(mixer);