summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 3d1aee7ac60..eadc8c873f4 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4599,10 +4599,6 @@ static void megasas_detach_one(struct pci_dev *pdev)
break;
default:
megasas_release_mfi(instance);
- pci_free_consistent(pdev,
- sizeof(struct megasas_evt_detail),
- instance->evt_detail,
- instance->evt_detail_h);
pci_free_consistent(pdev, sizeof(u32),
instance->producer,
instance->producer_h);
@@ -4612,6 +4608,9 @@ static void megasas_detach_one(struct pci_dev *pdev)
break;
}
+ if (instance->evt_detail)
+ pci_free_consistent(pdev, sizeof(struct megasas_evt_detail),
+ instance->evt_detail, instance->evt_detail_h);
scsi_host_put(host);
pci_set_drvdata(pdev, NULL);