uas: fail any request submitted while resetting the device.
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 30 Nov 2012 10:54:45 +0000 (11:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Jan 2013 20:14:18 +0000 (12:14 -0800)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/uas.c

index 547f96acad9c79fe2ce265bf3a632f422001ae8a..ebb99728551c9fae89687f64c6eacff99fceb460 100644 (file)
@@ -644,6 +644,12 @@ static int uas_queuecommand_lck(struct scsi_cmnd *cmnd,
 
        BUILD_BUG_ON(sizeof(struct uas_cmd_info) > sizeof(struct scsi_pointer));
 
+       if (devinfo->resetting) {
+               cmnd->result = DID_ERROR << 16;
+               cmnd->scsi_done(cmnd);
+               return 0;
+       }
+
        spin_lock_irqsave(&devinfo->lock, flags);
        if (devinfo->cmnd) {
                spin_unlock_irqrestore(&devinfo->lock, flags);