Skip to contentSkip to conversation

powerpc/powermac/low_i2c: Fix refcount leak bug in kw_i2c_probe()

PATCH Applied Liang He 2 participants 2 messages Jul 16, 2022 – Sep 9, 2022

Subsystems (2)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 powerpc/powermac/low_i2c: Fix refcount leak bug in kw_i2c_probe()

We should call of_node_put() for the reference 'parent' returned by of_get_parent() which has increased the refcount.

Fixes 730745a5c450 ("[PATCH] 1/5 powerpc: Rework PowerMac i2c part 1")
---
 arch/powerpc/platforms/powermac/low_i2c.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/low_i2c.c +1 -0
index c1c430c66dc9..40f3aa432fba 100644
@@ -627,6 +627,7 @@ static void __init kw_i2c_probe(void)
 			if (parent == NULL)
 				continue;
 			chans = parent->name[0] == 'u' ? 2 : 1;
+			of_node_put(parent);
 			for (i = 0; i < chans; i++)
 				kw_i2c_add(host, np, np, i);
 		} else {
Signature · 1 line
2.25.1