summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe F. Tonello <eu@felipetonello.com>2015-11-10 18:52:03 +0100
committerFelipe Balbi <balbi@ti.com>2015-11-19 21:48:50 +0100
commite9ca7e4bb30cbf4c8d2e2e34681a967c10b3ff54 (patch)
tree57269bfcfcf217a3ccff1bd4c1a086317ee7c4f8
parentusb: dwc2: make otg clk optional (diff)
downloadlinux-e9ca7e4bb30cbf4c8d2e2e34681a967c10b3ff54.tar.xz
linux-e9ca7e4bb30cbf4c8d2e2e34681a967c10b3ff54.zip
usb: gadget: f_midi: Transmit data only when IN ep is enabled
This makes sure f_midi doesn't try to enqueue data when the IN endpoint is disabled, ie, USB cable is disconnected. Reviewed-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/function/f_midi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 42acb45e1ab4..7877aa8e2aec 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -545,7 +545,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
}
}
- if (req->length > 0) {
+ if (req->length > 0 && ep->enabled) {
int err;
err = usb_ep_queue(ep, req, GFP_ATOMIC);