Skip to content

Commit

Permalink
powerpc/xics: fix refcount leak in icp_opal_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 5dd9e27 ]

The of_find_compatible_node() function returns a 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/20220402013419.2410298-1-lv.ruyi@zte.com.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Lv Ruyi authored and gregkh committed Jun 9, 2022
1 parent 8a665c2 commit 6a61a97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/sysdev/xics/icp-opal.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ int icp_opal_init(void)

printk("XICS: Using OPAL ICP fallbacks\n");

of_node_put(np);
return 0;
}

0 comments on commit 6a61a97

Please sign in to comment.