Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/xics: fix refcount leak in icp_opal_init()

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

authored by

Lv Ruyi and committed by
Michael Ellerman
5dd9e27e ab0cc6bb

+1
+1
arch/powerpc/sysdev/xics/icp-opal.c
··· 196 196 197 197 printk("XICS: Using OPAL ICP fallbacks\n"); 198 198 199 + of_node_put(np); 199 200 return 0; 200 201 } 201 202