Skip to content

Commit

Permalink
powerpc/powernv: Free name on error in opal_event_init()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
mpe committed Oct 15, 2024
1 parent 8956c58 commit cf8989d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/powernv/opal-irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit cf8989d

Please sign in to comment.