From a5901f27dcf13203e5b342b7e9439314a775bf32 Mon Sep 17 00:00:00 2001 From: "Geoffrey D. Bennett" Date: Fri, 27 Oct 2023 20:31:21 +1030 Subject: 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 --- sound/usb/mixer_scarlett2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/usb') diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c index 462a66d485c8..f7c57a2c3028 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); -- cgit