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)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:52 +0000 (09:09 -0700)
commit090cbc41c937f03311d34b72ab435444ad752cb6
tree1e15580289d138bd95ac8bbce06290165f9b6b43
parent8abaec8e7848c632fe6efd1bf661e66ea5c2dc79
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