summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasanari Iida <standby24x7@gmail.com>2013-02-08 07:57:44 +0100
committerJames Bottomley <JBottomley@Parallels.com>2013-02-22 13:21:49 +0100
commit552f3f9aca3b8aee5b1b52bece6771d3275ca744 (patch)
tree2f542561ffb1c97ad19c4e38ef2c28e732485b0f
parent[SCSI] qla2xxx: Get VPD information from common location for CNA. (diff)
downloadlinux-552f3f9aca3b8aee5b1b52bece6771d3275ca744.tar.xz
linux-552f3f9aca3b8aee5b1b52bece6771d3275ca744.zip
[SCSI] qla2xxx: Avoid null pointer dereference in shutdown routine.
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>
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 0612d2557e62..9e3ae1d8de51 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -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;