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>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 May 2021 13:09:24 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>
CC:     <eric.auger@...hat.com>, <alex.williamson@...hat.com>
Subject: [PATCH -next] vfio: platform: reset: add missing iounmap() on error in vfio_platform_amdxgbe_reset()

Add the missing iounmap() before return from vfio_platform_amdxgbe_reset()
in the error handling case.

Fixes: 0990822c9866 ("VFIO: platform: reset: AMD xgbe reset module")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
index abdca900802d..c6d823a27bd6 100644
--- a/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
+++ b/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
@@ -61,8 +61,10 @@ static int vfio_platform_amdxgbe_reset(struct vfio_platform_device *vdev)
 	if (!xpcs_regs->ioaddr) {
 		xpcs_regs->ioaddr =
 			ioremap(xpcs_regs->addr, xpcs_regs->size);
-		if (!xpcs_regs->ioaddr)
+		if (!xpcs_regs->ioaddr) {
+			iounmap(xgmac_regs->ioaddr);
 			return -ENOMEM;
+		}
 	}
 
 	/* reset the PHY through MDIO*/
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ