Commit cfd577ac authored by Colin Ian King's avatar Colin Ian King Committed by Takashi Iwai

ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails

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: 738d9edc ("ALSA: usb-audio: Add sanity checks for invalid EPs")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210420134719.381409-1-colin.king@canonical.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent bd15b155
...@@ -1316,7 +1316,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi, ...@@ -1316,7 +1316,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi,
error: error:
snd_usbmidi_in_endpoint_delete(ep); snd_usbmidi_in_endpoint_delete(ep);
return -ENOMEM; return err;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment