linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init
@ 2022-02-23  7:02 Hangyu Hua
  2022-03-07  1:41 ` Hangyu Hua
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Hangyu Hua @ 2022-02-23  7:02 UTC (permalink / raw)
  To: christophe.leroy, mpe, benh, paulus, peng.hao2, wen.yang99
  Cc: linuxppc-dev, linux-kernel, Hangyu Hua

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: cc76404feaed ("powerpc/8xx: Fix possible device node reference leak")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
---
 arch/powerpc/platforms/8xx/pic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/8xx/pic.c b/arch/powerpc/platforms/8xx/pic.c
index f2ba837249d6..04a6abf14c29 100644
--- a/arch/powerpc/platforms/8xx/pic.c
+++ b/arch/powerpc/platforms/8xx/pic.c
@@ -153,6 +153,7 @@ int __init mpc8xx_pic_init(void)
 	if (mpc8xx_pic_host == NULL) {
 		printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
 		ret = -ENOMEM;
+		goto out;
 	}
 
 	ret = 0;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-03-12 10:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23  7:02 [PATCH] powerpc: 8xx: fix a return value error in mpc8xx_pic_init Hangyu Hua
2022-03-07  1:41 ` Hangyu Hua
2022-03-08 15:00   ` Christophe Leroy
2022-03-09  3:24 ` Michael Ellerman
2022-03-09  7:21   ` Christophe Leroy
2022-03-09 10:46     ` Michael Ellerman
2022-03-09 11:13       ` Christophe Leroy
2022-03-09 23:16         ` Michael Ellerman
2022-03-12 10:29 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).