Message ID | 20240723014034.55802-1-flyingpeng@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: X86: conditionally call the release operation of memslot rmap | expand |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index af6c8cf6a37a..00a1d96699b8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -12947,7 +12947,8 @@ static int kvm_alloc_memslot_metadata(struct kvm *kvm, return 0; out_free: - memslot_rmap_free(slot); + if (kvm_memslots_have_rmaps(kvm)) + memslot_rmap_free(slot); for (i = 1; i < KVM_NR_PAGE_SIZES; ++i) { vfree(slot->arch.lpage_info[i - 1]);