Mtp func: prevent dev state change frome cancel to error.
authorJacobChen <cc@rock-chips.com>
Mon, 5 Dec 2011 07:00:31 +0000 (15:00 +0800)
committerJacobChen <cc@rock-chips.com>
Mon, 5 Dec 2011 07:00:31 +0000 (15:00 +0800)
drivers/usb/gadget/f_mtp.c

index 2829231327d4bccfbd2d3acf7f1483ccfbe7f18f..d1c259e3eb2dd087bfe752ba75bb8108717f73ee 100644 (file)
@@ -362,7 +362,7 @@ static void mtp_complete_out(struct usb_ep *ep, struct usb_request *req)
        struct mtp_dev *dev = _mtp_dev;
 
        dev->rx_done = 1;
-       if (req->status != 0)
+       if (req->status != 0 && dev->state != STATE_CANCELED)
                dev->state = STATE_ERROR;
 
        wake_up(&dev->read_wq);