summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe F. Tonello <eu@felipetonello.com>2015-11-10 17:52:06 (GMT)
committerFelipe Balbi <balbi@ti.com>2015-11-19 20:48:50 (GMT)
commitad0d1a058eac46503edbc510d1ce44c5df8e0c91 (patch)
tree797ca5e8b8f7baad0c30f4c796b292a441cfb964 /drivers/usb
parente9ca7e4bb30cbf4c8d2e2e34681a967c10b3ff54 (diff)
downloadlinux-ad0d1a058eac46503edbc510d1ce44c5df8e0c91.tar.xz
usb: gadget: f_midi: fix leak on failed to enqueue out requests
This patch fixes a memory leak that occurs when an endpoint fails to enqueue the request. If that happens the complete function will never be called, thus never freeing the request. Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/function/f_midi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 7877aa8..898a570 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -370,6 +370,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (err) {
ERROR(midi, "%s queue req: %d\n",
midi->out_ep->name, err);
+ free_ep_req(midi->out_ep, req);
}
}