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:   Mon, 13 Dec 2021 01:41:56 -0800
From:   Qing Wang <wangqing@...o.com>
To:     Russell King <linux@...linux.org.uk>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc:     Wang Qing <wangqing@...o.com>
Subject: [PATCH] arm: mach-at91: add missing of_node_put

From: Wang Qing <wangqing@...o.com>

Fix following coccicheck warning:
WARNING: Function "for_each_matching_node_and_match" 
should have of_node_put() before return.

Early exits from for_each_matching_node_and_match should decrement the
node reference counter.

Signed-off-by: Wang Qing <wangqing@...o.com>
---
 arch/arm/mach-at91/pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 8711d68..ca313fe
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -644,6 +644,7 @@ static __init int at91_dt_ramc(bool phy_mandatory)
 		soc_pm.data.ramc[idx] = of_iomap(np, 0);
 		if (!soc_pm.data.ramc[idx]) {
 			pr_err("unable to map ramc[%d] cpu registers\n", idx);
+			of_node_put(np);
 			ret = -ENOMEM;
 			goto unmap_ramc;
 		}
@@ -669,6 +670,7 @@ static __init int at91_dt_ramc(bool phy_mandatory)
 		soc_pm.data.ramc_phy = of_iomap(np, 0);
 		if (!soc_pm.data.ramc_phy) {
 			pr_err("unable to map ramc phy cpu registers\n");
+			of_node_put(np);
 			ret = -ENOMEM;
 			goto unmap_ramc;
 		}
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ