]> git.baikalelectronics.ru Git - kernel.git/commit
x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Wed, 23 Nov 2022 15:58:57 +0000 (23:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:57 +0000 (11:40 +0100)
commit35a42e97232987d9c1c97a6510d976109661b326
treeaa10b88e0e50b69fd39173723704bc87c2cca5e8
parente5a6e0531de865b939e44db009de47712ac238d2
x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()

[ Upstream commit 69143f60868b3939ddc89289b29db593b647295e ]

These local variables @{resched|pmu|callfunc...}_name saves the new
string allocated by kasprintf(), and when bind_{v}ipi_to_irqhandler()
fails, it goes to the @fail tag, and calls xen_smp_intr_free{_pv}() to
free resource, however the new string is not saved, which cause a memory
leak issue. fix it.

Fixes: 43d676babd35 ("i386: move xen")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20221123155858.11382-2-xiujianfeng@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/xen/smp.c
arch/x86/xen/smp_pv.c