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]
Message-Id: <20220615152849.3970438-1-windhl@126.com>
Date:   Wed, 15 Jun 2022 23:28:49 +0800
From:   Liang He <windhl@....com>
To:     tsbogend@...ha.franken.de, yangtiezhu@...ngson.cn
Cc:     linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        windhl@....com
Subject: [PATCH] mips: pic32: pic32mzda: Add missing of_node_put() in init.c

In pic32_of_prepare_platform_data(), of_find_compatible_node() will
return a node pointer with refcount incremented. We should use
of_node_put() when it is not used anymore.

Signed-off-by: Liang He <windhl@....com>
---
 arch/mips/pic32/pic32mzda/init.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/mips/pic32/pic32mzda/init.c b/arch/mips/pic32/pic32mzda/init.c
index 129915616763..2b134d5d54e1 100644
--- a/arch/mips/pic32/pic32mzda/init.c
+++ b/arch/mips/pic32/pic32mzda/init.c
@@ -99,9 +99,13 @@ static int __init pic32_of_prepare_platform_data(struct of_dev_auxdata *lookup)
 		if (np) {
 			lookup->name = (char *)np->name;
 			if (lookup->phys_addr)
+			{
+				of_node_put(np);
 				continue;
+			}
 			if (!of_address_to_resource(np, 0, &res))
 				lookup->phys_addr = res.start;
+			of_node_put(np);
 		}
 	}
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ