[SCSI] libsas: Don't issue commands to devices that have been hot-removed
[deliverable/linux.git] / drivers / scsi / libsas / sas_scsi_host.c
index f0cfba9a1fc83656f9dfa06cc2f0d1dd48115e72..1787bd2eb4a6a7b95645e1bae06b7fc73be18c26 100644 (file)
@@ -228,6 +228,13 @@ int sas_queuecommand(struct scsi_cmnd *cmd,
                        goto out;
                }
 
+               /* If the device fell off, no sense in issuing commands */
+               if (dev->gone) {
+                       cmd->result = DID_BAD_TARGET << 16;
+                       scsi_done(cmd);
+                       goto out;
+               }
+
                res = -ENOMEM;
                task = sas_create_task(cmd, dev, GFP_ATOMIC);
                if (!task)
This page took 0.029484 seconds and 5 git commands to generate.