diff mbox

[v2] scsi: megaraid_sas: fix allocate instance->pd_info twice

Message ID 20170808051549.GA11601@bogon.didichuxing.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

weiping zhang Aug. 8, 2017, 5:15 a.m. UTC
fix allocate instance->pd_info twice which was introduced by 96188a89cc6d.

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Sumit Saxena Aug. 8, 2017, 2:06 p.m. UTC | #1
>-----Original Message-----
>From: weiping zhang [mailto:zhangweiping@didichuxing.com]
>Sent: Tuesday, August 08, 2017 10:46 AM
>To: kashyap.desai@broadcom.com; sumit.saxena@broadcom.com;
>shivasharan.srikanteshwara@broadcom.com
>Cc: megaraidlinux.pdl@broadcom.com; linux-scsi@vger.kernel.org
>Subject: [PATCH v2] scsi: megaraid_sas: fix allocate instance->pd_info
twice
>
>fix allocate instance->pd_info twice which was introduced by
96188a89cc6d.
>
>Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
>---
> drivers/scsi/megaraid/megaraid_sas_base.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index 71c4746..a0f057c 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -6096,14 +6096,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");

Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>

>
>--
>2.9.4
Martin K. Petersen Aug. 11, 2017, 12:05 a.m. UTC | #2
weiping,

> fix allocate instance->pd_info twice which was introduced by
> 96188a89cc6d.

Applied to 4.14/scsi-queue, thank you!
diff mbox

Patch

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 71c4746..a0f057c 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -6096,14 +6096,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");