powerpc/powernv: fix missing of_node_put in uv_init()
[ Upstream commit 3ffa9fd471f57f365bc54fc87824c530422f64a5 ] of_find_compatible_node() returns node pointer with refcount incremented, use of_node_put() on it when done. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220407090043.2491854-1-lv.ruyi@zte.com.cn Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
6a61a97106
commit
0230055fa6
@@ -55,6 +55,7 @@ static int __init uv_init(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
uv_memcons = memcons_init(node, "memcons");
|
uv_memcons = memcons_init(node, "memcons");
|
||||||
|
of_node_put(node);
|
||||||
if (!uv_memcons)
|
if (!uv_memcons)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user