From: Gerd Hoffmann Date: Fri, 30 Nov 2012 10:54:45 +0000 (+0100) Subject: uas: fail any request submitted while resetting the device. X-Git-Tag: upstream/snapshot3+hdmi~5695^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8be6bfc5da027952e827a503e747fde5393adcc;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git uas: fail any request submitted while resetting the device. Signed-off-by: Gerd Hoffmann Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 547f96a..ebb9972 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -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);