From patchwork Tue Aug 8 05:15:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiping zhang X-Patchwork-Id: 9886575 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE7E760352 for ; Tue, 8 Aug 2017 05:31:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DACA42879C for ; Tue, 8 Aug 2017 05:31:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF542287A2; Tue, 8 Aug 2017 05:31:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3310E2879C for ; Tue, 8 Aug 2017 05:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751913AbdHHFbI (ORCPT ); Tue, 8 Aug 2017 01:31:08 -0400 Received: from mx1.didichuxing.com ([111.202.154.82]:28335 "EHLO BJEXCAS004.didichuxing.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750770AbdHHFbI (ORCPT ); Tue, 8 Aug 2017 01:31:08 -0400 X-Greylist: delayed 902 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Aug 2017 01:31:07 EDT Received: from bogon.didichuxing.com (172.22.50.20) by BJSGEXMBX04.didichuxing.com (172.20.15.134) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 8 Aug 2017 13:16:02 +0800 Date: Tue, 8 Aug 2017 13:15:55 +0800 From: weiping zhang To: , , CC: , Subject: [PATCH v2] scsi: megaraid_sas: fix allocate instance->pd_info twice Message-ID: <20170808051549.GA11601@bogon.didichuxing.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [172.22.50.20] X-ClientProxiedBy: BJEXCAS004.didichuxing.com (172.20.1.44) To BJSGEXMBX04.didichuxing.com (172.20.15.134) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fix allocate instance->pd_info twice which was introduced by 96188a89cc6d. Signed-off-by: weiping zhang Acked-by: Sumit Saxena --- 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");