Skip to content

Commit 0d727e1

Browse files
Ruliang Lintiwai
authored andcommitted
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: 523f1dc ("[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>
1 parent 7501f47 commit 0d727e1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sound/usb/caiaq/input.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)
804804

805805
default:
806806
/* no input methods supported on this device */
807+
ret = -EINVAL;
807808
goto exit_free_idev;
808809
}
809810

0 commit comments

Comments
 (0)