Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9ca7e4b authored by Felipe F. Tonello's avatar Felipe F. Tonello Committed by Felipe Balbi
Browse files

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: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarFelipe F. Tonello <eu@felipetonello.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8aa90cf2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);