diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-04-20 14:47:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-05-22 10:59:37 +0200 |
commit | f320604532d9ef364ba1f53f36cc0487d7f0e99f (patch) | |
tree | 00e9264d040e1de0ec4a3ec8ea005f4f1f5588ba /sound/usb | |
parent | 236b355dce28085db806cc1a544acd85a7360427 (diff) | |
download | linux-stable-f320604532d9ef364ba1f53f36cc0487d7f0e99f.tar.gz linux-stable-f320604532d9ef364ba1f53f36cc0487d7f0e99f.tar.bz2 linux-stable-f320604532d9ef364ba1f53f36cc0487d7f0e99f.zip |
ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails
[ Upstream commit cfd577acb769301b19c31361d45ae1f145318b7a ]
Currently when the call to usb_urb_ep_type_check fails (returning -EINVAL)
the error return path returns -ENOMEM via the exit label "error". Other
uses of the same error exit label set the err variable to -ENOMEM but this
is not being used. I believe the original intent was for the error exit
path to return the value in err rather than the hard coded -ENOMEM, so
return this rather than the hard coded -ENOMEM.
Addresses-Coverity: ("Unused value")
Fixes: 738d9edcfd44 ("ALSA: usb-audio: Add sanity checks for invalid EPs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210420134719.381409-1-colin.king@canonical.com
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/midi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c index 26548f760bc1..4553db0ef084 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1333,7 +1333,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, error: snd_usbmidi_in_endpoint_delete(ep); - return -ENOMEM; + return err; } /* |