summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorChaithanya Lagisetty <nagachaithanya9911@gmail.com>2026-09-04 21:44:54 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2026-09-04 21:44:54 +0800
commit910132bc7d72f26a8b288c2a38c32445a48d5be0 (patch)
tree2383eddfbd3ae80531734366f17ae393d11dae5d /scripts/Makefile.thinlto
parent4af22177032ab2357bf551fbfcdebc8fd9f2502d (diff)
downloadlinux-910132bc7d72f26a8b288c2a38c32445a48d5be0.tar.gz
linux-910132bc7d72f26a8b288c2a38c32445a48d5be0.zip
LoongArch: KVM: Fix resource leak in kvm_loongarch_env_init() error path
kvm_loongarch_env_init() allocates the per-CPU kvm_context (vmcs) and kvm_loongarch_ops, registers the perf callbacks, and then registers the IPI/EIOINTC/PCH-PIC/DMSINTC KVM devices. If any of those device registrations fails, the function returned the error directly, leaving everything acquired so far in place: vmcs and kvm_loongarch_ops are never freed, the perf callbacks stay registered, and all previously registered KVM device operations remain registered. kvm_loongarch_init() propagates the errors without calling kvm_loongarch_env_exit(), so nothing else cleans up either. Unwind the error path in reverse order of registration, so that each failure only undoes what had actually been set up. Use the same helpers in kvm_loongarch_env_exit() to remove the device registrations during normal teardown as well. Cc: stable@vger.kernel.org Fixes: c532de5a67a7 ("LoongArch: KVM: Add IPI device support") Reviewed-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions