[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190822171833.031560087@linuxfoundation.org>
Date: Thu, 22 Aug 2019 10:18:38 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, "Felipe F. Tonello" <eu@...ipetonello.com>,
Felipe Balbi <balbi@...com>
Subject: [PATCH 4.4 34/78] usb: gadget: f_midi: fail if set_alt fails to allocate requests
From: Felipe F. Tonello <eu@...ipetonello.com>
commit f0f1b8cac4d8d973e95f25d9ea132775fb43c5f4 upstream.
This ensures that the midi function will only work if the proper number of
IN and OUT requrests are allocated. Otherwise the function will work with less
requests then what the user wants.
Signed-off-by: Felipe F. Tonello <eu@...ipetonello.com>
Signed-off-by: Felipe Balbi <balbi@...com>
From: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/usb/gadget/function/f_midi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -364,9 +364,10 @@ static int f_midi_set_alt(struct usb_fun
req->complete = f_midi_complete;
err = usb_ep_queue(midi->out_ep, req, GFP_ATOMIC);
if (err) {
- ERROR(midi, "%s queue req: %d\n",
+ ERROR(midi, "%s: couldn't enqueue request: %d\n",
midi->out_ep->name, err);
free_ep_req(midi->out_ep, req);
+ return err;
}
}
Powered by blists - more mailing lists