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: <20220104133415.805209-1-yangyingliang@huawei.com>
Date:   Tue, 4 Jan 2022 21:34:15 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <linux-mips@...r.kernel.org>
CC:     <tsbogend@...ha.franken.de>, <zhangqing@...ngson.cn>
Subject: [PATCH -next] MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init()

This node pointer is returned by of_find_compatible_node() with
refcount incremented in ls2k_reset_init(). Calling of_node_put()
to aovid the refcount leak.

Fixes: 7eb7819a2e12 ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/platform/mips/ls2k-reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/mips/ls2k-reset.c b/drivers/platform/mips/ls2k-reset.c
index b70e7b8a092c..8f42d5d16480 100644
--- a/drivers/platform/mips/ls2k-reset.c
+++ b/drivers/platform/mips/ls2k-reset.c
@@ -38,6 +38,7 @@ static int ls2k_reset_init(void)
 	}
 
 	base = of_iomap(np, 0);
+	of_node_put(np);
 	if (!base) {
 		pr_info("Failed to map PM register base address\n");
 		return -ENOMEM;
@@ -46,7 +47,6 @@ static int ls2k_reset_init(void)
 	_machine_restart = ls2k_restart;
 	pm_power_off = ls2k_poweroff;
 
-	of_node_put(np);
 	return 0;
 }
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ