summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/f_midi.c
diff options
context:
space:
mode:
authorFelipe F. Tonello <eu@felipetonello.com>2015-12-01 21:31:01 +0300
committerFelipe Balbi <balbi@ti.com>2015-12-16 19:07:29 +0300
commitf0f1b8cac4d8d973e95f25d9ea132775fb43c5f4 (patch)
tree96e671e7601334cb4b7061195151b25370ae7186 /drivers/usb/gadget/function/f_midi.c
parent919de443c2acd9fbd691ea0ed7d1ad858e5f8bed (diff)
downloadlinux-f0f1b8cac4d8d973e95f25d9ea132775fb43c5f4.tar.xz
usb: gadget: f_midi: fail if set_alt fails to allocate requests
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@felipetonello.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/function/f_midi.c')
-rw-r--r--drivers/usb/gadget/function/f_midi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index e804231bd8e5..79dc611a2fc4 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -344,9 +344,10 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
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;
}
}