[SCSI] qla2xxx: Avoid null pointer dereference in shutdown routine.
authorMasanari Iida <standby24x7@gmail.com>
Fri, 8 Feb 2013 06:57:44 +0000 (01:57 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Fri, 22 Feb 2013 12:21:49 +0000 (12:21 +0000)
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla2xxx/qla_os.c

index 0612d2557e620aacfaca14765b327c31b1a15338..9e3ae1d8de513a46a91289def9b547361718efc8 100644 (file)
@@ -2808,6 +2808,9 @@ qla2x00_shutdown(struct pci_dev *pdev)
        scsi_qla_host_t *vha;
        struct qla_hw_data  *ha;
 
+       if (!atomic_read(&pdev->enable_cnt))
+               return;
+
        vha = pci_get_drvdata(pdev);
        ha = vha->hw;