ALSA: usb-audio: Handle the error from snd_usb_mixer_apply_create_quirk()
authorTakashi Iwai <tiwai@suse.de>
Wed, 24 Apr 2019 11:00:03 +0000 (13:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jan 2020 09:24:22 +0000 (10:24 +0100)
[ Upstream commit 328e9f6973be2ee67862cb17bf6c0c5c5918cd72 ]

The error from snd_usb_mixer_apply_create_quirk() is ignored in the
current usb-audio driver code, which will continue the probing even
after the error.  Let's take it more serious.

Fixes: 7b1eda223deb ("ALSA: usb-mixer: factor out quirks")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer.c

index 64fa1bbf0acb3e3287daaf76c18ea3d480154863..54011f8543a72ec21bba5f5f85f88adb43c231b4 100644 (file)
@@ -2626,7 +2626,9 @@ int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
            (err = snd_usb_mixer_status_create(mixer)) < 0)
                goto _error;
 
-       snd_usb_mixer_apply_create_quirk(mixer);
+       err = snd_usb_mixer_apply_create_quirk(mixer);
+       if (err < 0)
+               goto _error;
 
        err = snd_device_new(chip->card, SNDRV_DEV_CODEC, mixer, &dev_ops);
        if (err < 0)