diff options
author | Felipe F. Tonello <eu@felipetonello.com> | 2015-11-10 17:52:03 +0000 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-11-19 14:48:50 -0600 |
commit | e9ca7e4bb30cbf4c8d2e2e34681a967c10b3ff54 (patch) | |
tree | 57269bfcfcf217a3ccff1bd4c1a086317ee7c4f8 /drivers/usb/gadget/function/f_midi.c | |
parent | 8aa90cf2a28645c6733f8879c5fe1848c5d510b7 (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget/function/f_midi.c')
-rw-r--r-- | drivers/usb/gadget/function/f_midi.c | 2 |
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); |