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>
This commit is contained in:
parent
311449845f
commit
62519b10a4
1 changed files with 1 additions and 0 deletions
|
@ -285,6 +285,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue