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

Commit a5a732ae authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_mtp: Failing receive_file_work if state is OFFLINE"

parents edfc38fc 3968cc61
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -944,6 +944,10 @@ static void receive_file_work(struct work_struct *data)
		mtp_log("- count(%lld) not multiple of mtu(%d)\n",
						count, dev->ep_out->maxpacket);
	mutex_lock(&dev->read_mutex);
	if (dev->state == STATE_OFFLINE) {
		r = -EIO;
		goto fail;
	}
	while (count > 0 || write_req) {
		if (count > 0) {
			/* queue a request */
@@ -1026,6 +1030,7 @@ static void receive_file_work(struct work_struct *data)
			read_req = NULL;
		}
	}
fail:
	mutex_unlock(&dev->read_mutex);
	mtp_log("returning %d\n", r);
	/* write the result */