[SCSI] libsas: Don't issue commands to devices that have been hot-removed
[pandora-kernel.git] / drivers / scsi / libsas / sas_ata.c
index ddbade7..e1a395b 100644 (file)
@@ -162,6 +162,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
        unsigned int xfer = 0;
        unsigned int si;
 
+       /* If the device fell off, no sense in issuing commands */
+       if (dev->gone)
+               return AC_ERR_SYSTEM;
+
        task = sas_alloc_task(GFP_ATOMIC);
        if (!task)
                return AC_ERR_SYSTEM;