aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorWen Yang <wen.yang99@zte.com.cn>2019-03-26 18:29:51 +0800
committerMichael Ellerman <mpe@ellerman.id.au>2019-04-20 22:02:35 +1000
commitcc76404feaed597bb4f5234d34d3f49e2d1139bf (patch)
tree44d7a02ed2d418b2a89c61911c8ff2b893649386 /arch/powerpc
parentpowerpc/pseries: hwpoison the pages upon hitting UE (diff)
downloadlinux-dev-cc76404feaed597bb4f5234d34d3f49e2d1139bf.tar.xz
linux-dev-cc76404feaed597bb4f5234d34d3f49e2d1139bf.zip
powerpc/8xx: Fix possible device node reference leak
The call to of_find_compatible_node() returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. irq_domain_add_linear() also calls of_node_get() to increase refcount, so irq_domain() will not be affected when it is released. Detected by coccinelle. Fixes: a8db8cf0d894 ("irq_domain: Replace irq_alloc_host() with revmap-specific initializers") Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr> Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Peng Hao <peng.hao2@zte.com.cn> Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/8xx/pic.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/8xx/pic.c b/arch/powerpc/platforms/8xx/pic.c
index 8d5a25d43ef3..e9617d35fd1f 100644
--- a/arch/powerpc/platforms/8xx/pic.c
+++ b/arch/powerpc/platforms/8xx/pic.c
@@ -153,10 +153,9 @@ int mpc8xx_pic_init(void)
if (mpc8xx_pic_host == NULL) {
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
ret = -ENOMEM;
- goto out;
}
- return 0;
+ ret = 0;
out:
of_node_put(np);
return ret;