Paolo Bonzini dab77d8ca8 virt: guest_memfd: fix reference leak on hwpoisoned page
commit c31745d2c508796a0996c88bf2e55f552d513f65 upstream.

If kvm_gmem_get_pfn() detects an hwpoisoned page, it returns -EHWPOISON
but it does not put back the reference that kvm_gmem_get_folio() had
grabbed.  Add the forgotten folio_put().

Fixes: a7800aa80ea4 ("KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory")
Cc: stable@vger.kernel.org
Reviewed-by: Liam Merwick <liam.merwick@oracle.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-27 13:52:31 +02:00
..
2021-08-13 03:35:15 -04:00
2024-01-17 13:03:37 -08:00
2022-11-09 12:31:37 -05:00
2024-02-08 08:47:51 -05:00