summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2023-11-27 11:07:55 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 15:27:19 -0800
commit9a523e1da6d88c2034f946adfa4f74b236c95ca9 (patch)
tree02d5abae71a4c9569dee30c62e7fd8b7d99e9ca3 /arch/powerpc
parented8d023cfa97b559db58c0e1afdd2eec7a83d8f2 (diff)
downloadlinux-stable-9a523e1da6d88c2034f946adfa4f74b236c95ca9.tar.gz
linux-stable-9a523e1da6d88c2034f946adfa4f74b236c95ca9.tar.bz2
linux-stable-9a523e1da6d88c2034f946adfa4f74b236c95ca9.zip
powerpc/powernv: Add a null pointer check in opal_event_init()
[ Upstream commit 8649829a1dd25199bbf557b2621cedb4bf9b3050 ] kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: 2717a33d6074 ("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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/powernv/opal-irqchip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
index d55652b5f6fa..391f50535200 100644
--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
+++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
@@ -275,6 +275,8 @@ int __init opal_event_init(void)
else
name = kasprintf(GFP_KERNEL, "opal");
+ if (!name)
+ continue;
/* Install interrupt handler */
rc = request_irq(r->start, opal_interrupt, r->flags & IRQD_TRIGGER_MASK,
name, NULL);