From: Ruliang Lin Date: Thu, 4 May 2023 06:50:53 +0000 (+0800) Subject: ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caia... X-Git-Tag: v6.6.7~2882^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d727e1856ef22dd9337199430258cb64cbbc658;p=platform%2Fkernel%2Flinux-starfive.git ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init` 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 Reviewed-by: Dongliang Mu Acked-by: Daniel Mack Link: https://lore.kernel.org/r/20230504065054.3309-1-u202112092@hust.edu.cn Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c index 1e2cf2f..84f26dc 100644 --- a/sound/usb/caiaq/input.c +++ b/sound/usb/caiaq/input.c @@ -804,6 +804,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; }