Skip to content

Commit cf8989d

Browse files
committed
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 <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
1 parent 8956c58 commit cf8989d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ int __init opal_event_init(void)
282282
name, NULL);
283283
if (rc) {
284284
pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
285+
kfree(name);
285286
continue;
286287
}
287288
}

0 commit comments

Comments
 (0)