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: <20220617014008.851583-1-yangyingliang@huawei.com>
Date:   Fri, 17 Jun 2022 09:40:08 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-kernel@...r.kernel.org>, <linux-mtd@...ts.infradead.org>
CC:     <miquel.raynal@...tlin.com>, <csharper2005@...il.com>,
        <drvlabo@...il.com>
Subject: [PATCH -next] mtd: parsers: scpart: add missing of_node_put() in scpart_parse()

of_get_child_by_name() will increase the refcount of 'ofpart_node',
so add of_node_put() after using it to avoid refcount leak.

Fixes: 9b78ef0c7997 ("mtd: parsers: add support for Sercomm partitions")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 drivers/mtd/parsers/scpart.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/parsers/scpart.c b/drivers/mtd/parsers/scpart.c
index bc40e25dc105..02601bb33de4 100644
--- a/drivers/mtd/parsers/scpart.c
+++ b/drivers/mtd/parsers/scpart.c
@@ -219,6 +219,7 @@ static int scpart_parse(struct mtd_info *master,
 	of_node_put(pp);
 
 free:
+	of_node_put(ofpart_node);
 	kfree(scpart_map);
 	if (res <= 0)
 		kfree(parts);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ