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)
committerIliyan Malchev <malchev@google.com>
Mon, 23 May 2011 22:43:57 +0000 (15:43 -0700)
commit29df5ac340d4ad4f1b9c6f9a2d0a4ef602fbe63d
treecd2a8a446739fff4557d17af34cd454abea71172
parent8dd1873a964a3c8f971aa8ef97e0423f0f197e10
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