DORMANTno replies

[PATCH] arch: powerpc: add missing of_node_put before break

From: Qing Wang <hidden>
Date: 2021-12-13 09:48:55
Also in: lkml
Subsystem: linux for power macintosh, linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

From: Wang Qing <redacted>

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

Early exits from for_each_node_by_name should decrement the
node reference counter.

Signed-off-by: Wang Qing <redacted>
---
 arch/powerpc/platforms/powermac/smp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 3256a31..c9a044a
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -598,8 +598,10 @@ static void __init smp_core99_setup_i2c_hwsync(int ncpus)
 			name = "Pulsar";
 			break;
 		}
-		if (pmac_tb_freeze != NULL)
+		if (pmac_tb_freeze != NULL) {
+			of_node_put(cc);
 			break;
+		}
 	}
 	if (pmac_tb_freeze != NULL) {
 		/* Open i2c bus for synchronous access */
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help