kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails
@ 2021-04-20 13:47 Colin King
  2021-04-20 14:59 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-04-20 13:47 UTC (permalink / raw)
  To: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, alsa-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 sound/usb/midi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 9efda4b06acb..a10ac75969a8 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1316,7 +1316,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi,
 
  error:
 	snd_usbmidi_in_endpoint_delete(ep);
-	return -ENOMEM;
+	return err;
 }
 
 /*
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails
  2021-04-20 13:47 [PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails Colin King
@ 2021-04-20 14:59 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2021-04-20 14:59 UTC (permalink / raw)
  To: Colin King
  Cc: Clemens Ladisch, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	kernel-janitors, linux-kernel

On Tue, 20 Apr 2021 15:47:19 +0200,
Colin King wrote:
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-20 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 13:47 [PATCH] ALSA: usb: midi: don't return -ENOMEM when usb_urb_ep_type_check fails Colin King
2021-04-20 14:59 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).