فهرست منبع

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>
Felipe F. Tonello 9 سال پیش
والد
کامیت
e9ca7e4bb3
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/usb/gadget/function/f_midi.c

+ 1 - 1
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;
 		int err;
 
 
 		err = usb_ep_queue(ep, req, GFP_ATOMIC);
 		err = usb_ep_queue(ep, req, GFP_ATOMIC);