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]
Message-ID: <20210409044903.663632-1-yangyingliang@huawei.com>
Date:   Fri, 9 Apr 2021 12:49:03 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <linux-tegra@...r.kernel.org>
CC:     <jonathanh@...dia.com>, <thierry.reding@...il.com>
Subject: [PATCH -next] soc/tegra: fuse: add missing iounmap() on error in tegra_init_fuse()

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

Fixes: 9f94fadd75d3 ("soc/tegra: fuse: Register cell lookups for compatibility")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/soc/tegra/fuse/fuse-tegra.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 94b60a692b51..bc8d70e6a676 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -489,8 +489,10 @@ static int __init tegra_init_fuse(void)
 		size_t size = sizeof(*fuse->lookups) * fuse->soc->num_lookups;
 
 		fuse->lookups = kmemdup(fuse->soc->lookups, size, GFP_KERNEL);
-		if (!fuse->lookups)
+		if (!fuse->lookups) {
+			iounmap(fuse->base);
 			return -ENOMEM;
+		}
 
 		nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups);
 	}
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ