lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat, 31 Oct 2020 10:16:53 +0800
From:   Qinglang Miao <miaoqinglang@...wei.com>
To:     Nilesh Javali <njavali@...vell.com>,
        <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
CC:     <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        "Qinglang Miao" <miaoqinglang@...wei.com>
Subject: [PATCH] scsi: qla2xxx: add missing iounmap() on error in qlafx00_iospace_config

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 <miaoqinglang@...wei.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ