diff options
author | Kunwu Chan <chentao@kylinos.cn> | 2023-11-27 06:07:55 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-12-13 14:19:03 +0300 |
commit | 8649829a1dd25199bbf557b2621cedb4bf9b3050 (patch) | |
tree | 11206dbbdb051ebca8a39380a15f10578c9a1cb2 /arch | |
parent | 9a260f2dd827bbc82cc60eb4f4d8c22707d80742 (diff) | |
download | linux-8649829a1dd25199bbf557b2621cedb4bf9b3050.tar.xz |
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: 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
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/powernv/opal-irqchip.c | 2 |
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 f9a7001dacb7..56a1f7ce78d2 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); |