scsi: megaraid_sas: fix allocate instance->pd_info twice
authorweiping <zhangweiping@didichuxing.com>
Tue, 8 Aug 2017 05:15:55 +0000 (13:15 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Aug 2017 23:55:35 +0000 (19:55 -0400)
fix allocate instance->pd_info twice which was introduced by 96188a89cc6d.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index 03693c438b673ab5dbc0df73b180088c8ef46ffe..5202c2fd72ac3f2eb5ae2228302e233b9b94b45f 100644 (file)
@@ -6097,14 +6097,12 @@ static int megasas_probe_one(struct pci_dev *pdev,
                instance->pd_info = pci_alloc_consistent(pdev,
                        sizeof(struct MR_PD_INFO), &instance->pd_info_h);
 
-               instance->pd_info = pci_alloc_consistent(pdev,
-                       sizeof(struct MR_PD_INFO), &instance->pd_info_h);
-               instance->tgt_prop = pci_alloc_consistent(pdev,
-                       sizeof(struct MR_TARGET_PROPERTIES), &instance->tgt_prop_h);
-
                if (!instance->pd_info)
                        dev_err(&instance->pdev->dev, "Failed to alloc mem for pd_info\n");
 
+               instance->tgt_prop = pci_alloc_consistent(pdev,
+                       sizeof(struct MR_TARGET_PROPERTIES), &instance->tgt_prop_h);
+
                if (!instance->tgt_prop)
                        dev_err(&instance->pdev->dev, "Failed to alloc mem for tgt_prop\n");