scsi_dh: return SCSI_DH_NOTCONN in scsi_dh_activate()
authorHannes Reinecke <hare@suse.de>
Thu, 27 Aug 2015 12:17:02 +0000 (14:17 +0200)
committerJames Bottomley <JBottomley@Odin.com>
Fri, 28 Aug 2015 20:14:58 +0000 (13:14 -0700)
When calling scsi_dh_activate() we should be returning
SCSI_DH_NOTCONN if the device handler couldn't be attached.

Reviewed-by: Bart van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/scsi_dh.c

index 9f6511da5023903b0b55cf6066b346b605e55930..edb044a7b56d348a269634212155edce3a89f9b8 100644 (file)
@@ -326,6 +326,7 @@ int scsi_dh_activate(struct request_queue *q, activate_complete fn, void *data)
 
        if (!sdev->handler)
                goto out_fn;
+       err = SCSI_DH_NOTCONN;
        if (sdev->sdev_state == SDEV_CANCEL ||
            sdev->sdev_state == SDEV_DEL)
                goto out_fn;