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:   Thu, 21 Apr 2022 20:23:03 +0800
From:   Wan Jiabing <wanjiabing@...o.com>
To:     Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     kael_w@...h.net, Wan Jiabing <wanjiabing@...o.com>
Subject: [PATCH] of: Add missing of_node_put() before return

Fix the following coccicheck error:
drivers/of/platform.c:554:2-23: WARNING: Function "for_each_node_by_type"
should have of_node_put() before return around line 560.

Early exits from for_each_node_by_type() should decrement the node
reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 2dff3a3d137c..3c7ca6671716 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -556,8 +556,10 @@ static int __init of_platform_default_populate_init(void)
 			    !of_get_property(node, "linux,boot-display", NULL))
 				continue;
 			dev = of_platform_device_create(node, "of-display", NULL);
-			if (WARN_ON(!dev))
+			if (WARN_ON(!dev)) {
+				of_node_put(node)
 				return -ENOMEM;
+			}
 			boot_display = node;
 			break;
 		}
-- 
2.35.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ