Commit cf8989d2 authored by Michael Ellerman's avatar Michael Ellerman

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: default avatar2639161967 <2639161967@qq.com>
Closes: https://lore.kernel.org/linuxppc-dev/87wmjp3wig.fsf@mail.lhotseSigned-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/20240920093520.67997-1-mpe@ellerman.id.au
parent 8956c582
...@@ -282,6 +282,7 @@ int __init opal_event_init(void) ...@@ -282,6 +282,7 @@ int __init opal_event_init(void)
name, NULL); name, NULL);
if (rc) { if (rc) {
pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start); pr_warn("Error %d requesting OPAL irq %d\n", rc, (int)r->start);
kfree(name);
continue; continue;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment