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")
Signed-off-by: Liang He <[email protected]>
---
 arch/powerpc/platforms/powermac/low_i2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/powermac/low_i2c.c 
b/arch/powerpc/platforms/powermac/low_i2c.c
index c1c430c66dc9..40f3aa432fba 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -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 {
-- 
2.25.1

Reply via email to