ANDROID: usb: f_mtp: return error code if transfer error in receive_file_work function
authorJiebing Li <jiebing.li@intel.com>
Tue, 10 Mar 2015 03:27:10 +0000 (11:27 +0800)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 25 May 2017 11:07:25 +0000 (16:37 +0530)
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 <changbin.du@gmail.com>
Signed-off-by: Wang, Yu <yu.y.wang@intel.com>
Signed-off-by: Russ Weight <russell.h.weight@intel.com>
drivers/usb/gadget/function/f_mtp.c

index 0fa79b0c26ab4f217b942930d83959c1e6b2165d..87ec420df0a67e7ed5986137064889ee2be9b4c7 100644 (file)
@@ -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
                         */