OSDN Git Service

USB: gadget: f_mtp: Fix problems transferring files from device to host
authorMike Lockwood <lockwood@android.com>
Mon, 7 Feb 2011 16:51:07 +0000 (11:51 -0500)
committerBrian Swetland <swetland@google.com>
Tue, 29 Mar 2011 20:58:04 +0000 (13:58 -0700)
commit87e72300ba68b7336f670d5aeaffe0185575e506
treeac4163772eee0267bbf929d9e4ef27429e45d343
parent7fe6334d85372a3faacfcb76e3477b62fc1d9db1
USB: gadget: f_mtp: Fix problems transferring files from device to host

Exit from send_file_work immediately when a cancel request is received.

Only busy status if there is a cancel pending that has not been repoorted to userspace.
This avoids a race condition that can occur when mtp_read resets the state
to STATE_BUSY before we report status OK back to the host.

Signed-off-by: Mike Lockwood <lockwood@android.com>
drivers/usb/gadget/f_mtp.c