diff options
author | Geoffrey D. Bennett <g@b4.vu> | 2023-12-19 20:37:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-26 02:35:39 +0300 |
commit | 996fde492ad9b9563ee483b363af40d7696a8467 (patch) | |
tree | e56af67cdc1c8a10c0be088206ec2aeb4b54d33c /sound/usb | |
parent | 43a9b3f6e6ef5872358abf5975e77cf505e97c41 (diff) | |
download | linux-996fde492ad9b9563ee483b363af40d7696a8467.tar.xz |
ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config()
[ Upstream commit ca459dfa7d4ed9098fcf13e410963be6ae9b6bf3 ]
scarlett2_usb_set_config() calls scarlett2_usb_get() but was not
checking the result. Return the error if it fails rather than
continuing with an invalid value.
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Fixes: 9e15fae6c51a ("ALSA: usb-audio: scarlett2: Allow bit-level access to config")
Link: https://lore.kernel.org/r/def110c5c31dbdf0a7414d258838a0a31c0fab67.1703001053.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/mixer_scarlett_gen2.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/usb/mixer_scarlett_gen2.c b/sound/usb/mixer_scarlett_gen2.c index 64cfe2d6045e..834b936e7106 100644 --- a/sound/usb/mixer_scarlett_gen2.c +++ b/sound/usb/mixer_scarlett_gen2.c @@ -1390,7 +1390,10 @@ static int scarlett2_usb_set_config( size = 1; offset = config_item->offset; - scarlett2_usb_get(mixer, offset, &tmp, 1); + err = scarlett2_usb_get(mixer, offset, &tmp, 1); + if (err < 0) + return err; + if (value) tmp |= (1 << index); else |