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)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:06:59 +0000 (12:06 -0800)
commit1b44e9c94df84e01cafd6e8f86df90a3a60502dd
tree218bd0299af355f483ea5cbfa909920e244925f3
parent0cb7edb3714599d38ff00e53c7b5d8d766012b1e
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