Message ID | 20250101064928.389504-1-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | KVM: allow NULL writable argument to __kvm_faultin_pfn | expand |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index de2c11dae231..5177e56fdbd5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2975,10 +2975,11 @@ kvm_pfn_t __kvm_faultin_pfn(const struct kvm_memory_slot *slot, gfn_t gfn, .refcounted_page = refcounted_page, }; - if (WARN_ON_ONCE(!writable || !refcounted_page)) + if (WARN_ON_ONCE(!refcounted_page)) return KVM_PFN_ERR_FAULT; - *writable = false; + if (writable) + *writable = false; *refcounted_page = NULL; return kvm_follow_pfn(&kfp);