Skip to content

Commit 8649829

Browse files
KunWuChanmpe
authored andcommitted
powerpc/powernv: Add a null pointer check in opal_event_init()
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: 2717a33 ("powerpc/opal-irqchip: Use interrupt names if present") Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231127030755.1546750-1-chentao@kylinos.cn
1 parent 9a260f2 commit 8649829

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/powerpc/platforms/powernv/opal-irqchip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ int __init opal_event_init(void)
275275
else
276276
name = kasprintf(GFP_KERNEL, "opal");
277277

278+
if (!name)
279+
continue;
278280
/* Install interrupt handler */
279281
rc = request_irq(r->start, opal_interrupt, r->flags & IRQD_TRIGGER_MASK,
280282
name, NULL);

0 commit comments

Comments
 (0)