Commit 589b1f7e authored by YueHaibing's avatar YueHaibing Committed by Michael Ellerman

powerpc/xics: Add missing of_node_put() in error path

The device node obtained with of_find_compatible_node() should be
released by calling of_node_put().  But it was not released when
of_get_property() failed.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
[mpe: Invert the sense of the if so we only need one return path]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent c5cbde2d
...@@ -446,10 +446,11 @@ static void __init xics_get_server_size(void) ...@@ -446,10 +446,11 @@ static void __init xics_get_server_size(void)
np = of_find_compatible_node(NULL, NULL, "ibm,ppc-xics"); np = of_find_compatible_node(NULL, NULL, "ibm,ppc-xics");
if (!np) if (!np)
return; return;
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL); isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
if (!isize) if (isize)
return; xics_interrupt_server_size = be32_to_cpu(*isize);
xics_interrupt_server_size = be32_to_cpu(*isize);
of_node_put(np); of_node_put(np);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment