From 8bb6e5139ebe6a37df26911a54ae7e5a27ad1615 Mon Sep 17 00:00:00 2001 From: Jiebing Li Date: Tue, 10 Mar 2015 11:27:10 +0800 Subject: [PATCH] ANDROID: usb: f_mtp: return error code if transfer error in receive_file_work function receive_file_work() function should report error if it detect the urb is not successfully transfered. Patchset: mtp Change-Id: I66898afe6b6ea2c33e6ea4c5ccf47d3a56d002dc Signed-off-by: Du, Changbin Signed-off-by: Wang, Yu Signed-off-by: Russ Weight --- drivers/usb/gadget/function/f_mtp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/function/f_mtp.c b/drivers/usb/gadget/function/f_mtp.c index 0fa79b0c26ab..87ec420df0a6 100644 --- a/drivers/usb/gadget/function/f_mtp.c +++ b/drivers/usb/gadget/function/f_mtp.c @@ -873,6 +873,10 @@ static void receive_file_work(struct work_struct *data) usb_ep_dequeue(dev->ep_out, read_req); break; } + if (read_req->status) { + r = read_req->status; + break; + } /* if xfer_file_length is 0xFFFFFFFF, then we read until * we get a zero length packet */ -- 2.34.1