Skip to content
Commit d7c9bfb9 authored by Miaohe Lin's avatar Miaohe Lin Committed by Sean Christopherson
Browse files

KVM: x86/mmu: fix memoryleak in kvm_mmu_vendor_module_init()



When register_shrinker() fails, KVM doesn't release the percpu counter
kvm_total_used_mmu_pages leading to memoryleak. Fix this issue by calling
percpu_counter_destroy() when register_shrinker() fails.

Fixes: ab271bd4 ("x86: kvm: propagate register_shrinker return code")
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Link: https://lore.kernel.org/r/20220823063237.47299-1-linmiaohe@huawei.com


[sean: tweak shortlog and changelog]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 6aa5c47c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment