summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2024-09-20 19:35:20 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-17 14:59:39 +0100
commit7e222d2c7f9ab06280110edd3b0c4340ff9f2a29 (patch)
tree46eb0b3b3e426eb51b7a318ee9f602816c88c82c
parentb718f71747b7e4e9ed83230f9dcde38110a9cd1c (diff)
downloadlinux-7e222d2c7f9ab06280110edd3b0c4340ff9f2a29.tar.gz
linux-7e222d2c7f9ab06280110edd3b0c4340ff9f2a29.tar.bz2
linux-7e222d2c7f9ab06280110edd3b0c4340ff9f2a29.zip
powerpc/powernv: Free name on error in opal_event_init()
[ Upstream commit cf8989d20d64ad702a6210c11a0347ebf3852aa7 ] In opal_event_init() if request_irq() fails name is not freed, leading to a memory leak. The code only runs at boot time, there's no way for a user to trigger it, so there's no security impact. Fix the leak by freeing name in the error path. Reported-by: 2639161967 <2639161967@qq.com> Closes: https://lore.kernel.org/linuxppc-dev/87wmjp3wig.fsf@mail.lhotse Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20240920093520.67997-1-mpe@ellerman.id.au Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/powerpc/platforms/powernv/opal-irqchip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/opal-irqchip.c b/arch/powerpc/platforms/powernv/opal-irqchip.c
index dcec0f760c8f..522bda391179 100644
--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
+++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
@@ -285,6 +285,7 @@ int __init opal_event_init(void)
name, NULL);
if (rc) {
pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
+ kfree(name);
continue;
}
}