diff options
author | Sean Christopherson <seanjc@google.com> | 2024-10-10 20:23:04 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-10-25 18:54:42 +0200 |
commit | 85e88b2bbaacb4135499fdb219f78ac38ef6e8d4 (patch) | |
tree | 00ae462b93244249f9f7d83690794759437fb2d4 /virt | |
parent | KVM: Drop KVM_ERR_PTR_BAD_PAGE and instead return NULL to indicate an error (diff) | |
download | linux-85e88b2bbaacb4135499fdb219f78ac38ef6e8d4.tar.xz linux-85e88b2bbaacb4135499fdb219f78ac38ef6e8d4.zip |
KVM: Allow calling kvm_release_page_{clean,dirty}() on a NULL page pointer
Allow passing a NULL @page to kvm_release_page_{clean,dirty}(), there's no
tangible benefit to forcing the callers to pre-check @page, and it ends up
generating a lot of duplicate boilerplate code.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20241010182427.1434605-3-seanjc@google.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 5fc95504affe..e7561ca96a09 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3167,7 +3167,7 @@ static void kvm_set_page_accessed(struct page *page) void kvm_release_page_clean(struct page *page) { - if (WARN_ON(!page)) + if (!page) return; kvm_set_page_accessed(page); @@ -3192,7 +3192,7 @@ EXPORT_SYMBOL_GPL(kvm_release_pfn_clean); void kvm_release_page_dirty(struct page *page) { - if (WARN_ON(!page)) + if (!page) return; kvm_set_page_dirty(page); |