powerpc/powermac/low_i2c: Fix refcount leak bug in kw_i2c_probe()
Subsystems (2)
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")
Signed-off-by Liang He <[email protected]>
--- arch/powerpc/platforms/powermac/low_i2c.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/low_i2c.c +1 -0
@@ -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
Michael Ellerman
AppliedQuoted 4 lines · Liang He
We should call
of_node_put()for the reference 'parent' returned byof_get_parent()which has increased the refcount.
Applied to powerpc/next.
[1/1] powerpc/powermac/low_i2c: Fix refcount leak bug in kw_i2c_probe()
https://git.kernel.org/powerpc/c/b3d6637bcc5d17caec56a76f6e430dcf444ef80e
cheers