summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuliang Lin <u202112092@hust.edu.cn>2023-05-04 14:50:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 11:11:49 +0200
commit962f1c8c0cc767c097c76ca13c8490b7f6e848d7 (patch)
treebffc257dce9b03ca46472a933092ab2356393918
parent13d67aa0c258732155ad8e3992c0fe32df881824 (diff)
downloadlinux-stable-962f1c8c0cc767c097c76ca13c8490b7f6e848d7.tar.gz
linux-stable-962f1c8c0cc767c097c76ca13c8490b7f6e848d7.tar.bz2
linux-stable-962f1c8c0cc767c097c76ca13c8490b7f6e848d7.zip
ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init`
[ Upstream commit 0d727e1856ef22dd9337199430258cb64cbbc658 ] Smatch complains that: snd_usb_caiaq_input_init() warn: missing error code 'ret' This patch adds a new case to handle the situation where the device does not support any input methods in the `snd_usb_caiaq_input_init` function. It returns an `-EINVAL` error code to indicate that no input methods are supported on the device. Fixes: 523f1dce3743 ("[ALSA] Add Native Instrument usb audio device support") Signed-off-by: Ruliang Lin <u202112092@hust.edu.cn> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn> Acked-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20230504065054.3309-1-u202112092@hust.edu.cn Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/usb/caiaq/input.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c
index 4b3fb91deecd..0898d2dd14e4 100644
--- a/sound/usb/caiaq/input.c
+++ b/sound/usb/caiaq/input.c
@@ -808,6 +808,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)
default:
/* no input methods supported on this device */
+ ret = -EINVAL;
goto exit_free_idev;
}