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)
committerMike Lockwood <lockwood@android.com>
Mon, 7 Feb 2011 16:59:43 +0000 (11:59 -0500)
commit7fe4e995ccc36f56acc51ee3a1c392ac23d2a122
tree93f4c104c6612ce3b842b5c2e234ba9787831269
parent23b6f13927416ced600e5a27f4d17ba54d857ad9
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