Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1754365pxx; Fri, 30 Oct 2020 19:26:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiI1flKa7tLdJU2d7a2ecnSuWJDNcUaxp/qvNLCp9XsBUE0jAszA+53H8nk7HY99oa6Pt0 X-Received: by 2002:a05:6402:1691:: with SMTP id a17mr5511570edv.264.1604111195830; Fri, 30 Oct 2020 19:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604111195; cv=none; d=google.com; s=arc-20160816; b=cZL227yEOLBckgsSevwM+LHwTS6Zyp0bcYHxLuceD81e7jOV0RDANRN6jlyliPixqS XdPhdf+TdPLmycN9vtzjMWFqEh8lJxXS3BbqoeyHk3OxoIR+SvHyEbBtZ6aRQiRSoZ1Q s+nEq2Z1z0bROw6jmunBMGzn4Dq+9LUfyWdd8qjAJiYkMk0pk42pV9G/Le6mhCBRl/aD KoXYsPL/DtSALWw0qj1BKb//UkisjBvH6YnnnUY/5gVuWIdMTXbBL9R6T3s672V12iSF V5K5PYLVA+HBGmtlx39fQJaH40Q3g/FavDbw1mP7iq+UbWBgaRMJUGot9MJazaXMj50z NebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=H8vKCjKb1EFnXu0rEr1CI62oTuJv5B1LaMxNWHWKafU=; b=Ncs6vs66Gk6M3QYCvNxSF/Up0zjt8PofaeG/itXVOlFbo0YoHFGMlI4brv9ECzQp8V 3uW66yoo+2dCKapYGnalj4ehrfQAy1iDhWR3YxZU0QAbzNCTIUOURkr3BQn57G509Bto v9xtLWSrIrERnlEgmWvddIhgTNU5ezZKUWQ9EY7Fw6H8mFlYxFq+lZAhtjx9no7unzNy YzSqwDByQ1m8RsJ7Hjd6h/D8lYWcc2471XXPQwU5y8I4PmLAQZWtzAKrpp3AKNCmHh8n HaAi52Imr2YCKcJb/Te+HD+rhI1fzXQHxO7C1LSJCmiiZCgt6c2NO0I2z46dzbhMsXso RNDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lx14si5467051ejb.115.2020.10.30.19.25.38; Fri, 30 Oct 2020 19:26:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725963AbgJaCLT (ORCPT + 99 others); Fri, 30 Oct 2020 22:11:19 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6674 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgJaCLT (ORCPT ); Fri, 30 Oct 2020 22:11:19 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CNN2Z01vnz15MJr; Sat, 31 Oct 2020 10:11:18 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sat, 31 Oct 2020 10:11:07 +0800 From: Qinglang Miao To: Nilesh Javali , , "James E.J. Bottomley" , "Martin K. Petersen" CC: , , "Qinglang Miao" Subject: [PATCH] scsi: qla2xxx: add missing iounmap() on error in qlafx00_iospace_config Date: Sat, 31 Oct 2020 10:16:53 +0800 Message-ID: <20201031021653.186554-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the missing iounmap() before return from qlafx00_iospace_config in the error handling case when os failed to do ioremap for ha->iobase. Signed-off-by: Qinglang Miao --- drivers/scsi/qla2xxx/qla_mr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index ca7306685..c6fcd47de 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c @@ -798,13 +798,13 @@ qlafx00_iospace_config(struct qla_hw_data *ha) ql_log_pci(ql_log_warn, ha->pdev, 0x0129, "region #2 not an MMIO resource (%s), aborting\n", pci_name(ha->pdev)); - goto iospace_error_exit; + goto ha_iobase_exit; } if (pci_resource_len(ha->pdev, 2) < BAR2_LEN_FX00) { ql_log_pci(ql_log_warn, ha->pdev, 0x012a, "Invalid PCI mem BAR2 region size (%s), aborting\n", pci_name(ha->pdev)); - goto iospace_error_exit; + goto ha_iobase_exit; } ha->iobase = @@ -812,7 +812,7 @@ qlafx00_iospace_config(struct qla_hw_data *ha) if (!ha->iobase) { ql_log_pci(ql_log_fatal, ha->pdev, 0x012b, "cannot remap MMIO (%s), aborting\n", pci_name(ha->pdev)); - goto iospace_error_exit; + goto ha_iobase_exit; } /* Determine queue resources */ @@ -824,6 +824,8 @@ qlafx00_iospace_config(struct qla_hw_data *ha) return 0; +ha_iobase_exit: + iounmap(ha->cregbase); iospace_error_exit: return -ENOMEM; } -- 2.23.0