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: <20220407085829.2491655-1-lv.ruyi@zte.com.cn>
Date:   Thu,  7 Apr 2022 08:58:29 +0000
From:   cgel.zte@...il.com
To:     daniel.lezcano@...aro.org, tglx@...utronix.de
Cc:     linux-kernel@...r.kernel.org, Lv Ruyi <lv.ruyi@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] clocksource/drivers/timer-ti-dm: fix missing of_node_put

From: Lv Ruyi <lv.ruyi@....com.cn>

of_find_compatible_node returns node pointer with refcount incremented,
use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>
---
 drivers/clocksource/timer-ti-dm-systimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
index 2737407ff069..a58df7749db3 100644
--- a/drivers/clocksource/timer-ti-dm-systimer.c
+++ b/drivers/clocksource/timer-ti-dm-systimer.c
@@ -691,9 +691,11 @@ static int __init dmtimer_percpu_quirk_init(struct device_node *np, u32 pa)
 	arm_timer = of_find_compatible_node(NULL, NULL, "arm,armv7-timer");
 	if (of_device_is_available(arm_timer)) {
 		pr_warn_once("ARM architected timer wrap issue i940 detected\n");
+		of_node_put(arm_timer);
 		return 0;
 	}
 
+	of_node_put(arm_timer);
 	if (pa == 0x4882c000)           /* dra7 dmtimer15 */
 		return dmtimer_percpu_timer_init(np, 0);
 	else if (pa == 0x4882e000)      /* dra7 dmtimer16 */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ