aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ellerman <[email protected]>2024-09-20 19:35:20 +1000
committerMichael Ellerman <[email protected]>2024-10-16 09:26:50 +1100
commitcf8989d20d64ad702a6210c11a0347ebf3852aa7 (patch)
tree4c7c4351f7d1ac4d018b61d18ef188748cd51ba6
parent8956c582ac6b1693a351230179f898979dd00bdf (diff)
powerpc/powernv: Free name on error in opal_event_init()
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 <[email protected]> Closes: https://lore.kernel.org/linuxppc-dev/[email protected] Signed-off-by: Michael Ellerman <[email protected]> Link: https://patch.msgid.link/[email protected]
-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 56a1f7ce78d2..d92759c21fae 100644
--- a/arch/powerpc/platforms/powernv/opal-irqchip.c
+++ b/arch/powerpc/platforms/powernv/opal-irqchip.c
@@ -282,6 +282,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;
}
}