Skip to content

Commit 3fd46e5

Browse files
HBh25Ympe
authored andcommitted
powerpc: 8xx: fix a return value error in mpc8xx_pic_init
mpc8xx_pic_init() should return -ENOMEM instead of 0 when irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to continue executing even if mpc8xx_pic_host is NULL. Fixes: cc76404 ("powerpc/8xx: Fix possible device node reference leak") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220223070223.26845-1-hbh25y@gmail.com
1 parent 9f51960 commit 3fd46e5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • arch/powerpc/platforms/8xx

arch/powerpc/platforms/8xx/pic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ int __init mpc8xx_pic_init(void)
153153
if (mpc8xx_pic_host == NULL) {
154154
printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
155155
ret = -ENOMEM;
156+
goto out;
156157
}
157158

158159
ret = 0;

0 commit comments

Comments
 (0)