From 552f3f9aca3b8aee5b1b52bece6771d3275ca744 Mon Sep 17 00:00:00 2001 From: Masanari Iida Date: Fri, 8 Feb 2013 01:57:44 -0500 Subject: [PATCH] [SCSI] qla2xxx: Avoid null pointer dereference in shutdown routine. Signed-off-by: Masanari Iida Signed-off-by: Saurav Kashyap Signed-off-by: James Bottomley --- drivers/scsi/qla2xxx/qla_os.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5