From: Sumit.Saxena@lsi.com Date: Wed, 22 May 2013 07:00:54 +0000 (+0530) Subject: [SCSI] megaraid_sas: Free event detail memory without device ID check X-Git-Tag: firefly_0821_release~176^2~5775^2~67 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=105900d56e6f8a4dd47bb88fa387ab22ea787884;p=firefly-linux-kernel-4.4.55.git [SCSI] megaraid_sas: Free event detail memory without device ID check Free event detail memory from more common place, instead of doing it for limited device types. Signed-off-by: Sumit Saxena Signed-off-by: Adam Radford Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 3d1aee7ac604..eadc8c873f45 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);