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

Commit 059df04a authored by Hemant Kumar's avatar Hemant Kumar
Browse files

USB: f_mtp: Check if the ep is not disabled before queuing it



Queuing a request on a disabled endpoint during composition switch leads
to prime failure. Hence return -EINVAL if a request is queued on a disabled
endpoint.

Also, in f_mtp, block queuing a request in OUT ep in receive_file_work, if
the device state is STATE_OFFLINE.

Change-Id: I0e706d5280a2460baf6ab05dbf97a09c59b642fb
Signed-off-by: default avatarRajkumar Raghupathy <raghup@codeaurora.org>
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 79dead75
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -939,7 +939,8 @@ static void receive_file_work(struct work_struct *data)
			/* wait for our last read to complete */
			ret = wait_event_interruptible(dev->read_wq,
				dev->rx_done || dev->state != STATE_BUSY);
			if (dev->state == STATE_CANCELED) {
			if (dev->state == STATE_CANCELED
					|| dev->state == STATE_OFFLINE) {
				r = -ECANCELED;
				if (!dev->rx_done)
					usb_ep_dequeue(dev->ep_out, read_req);