KVM: selftests: Add missing close and munmap in __vm_mem_region_delete()
authorRicardo Koller <ricarkol@google.com>
Mon, 17 Oct 2022 19:58:23 +0000 (19:58 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 19:10:27 +0000 (19:10 +0000)
commitb6b03b86c0250a80b671313dbc0d7bcdbab78f41
tree8b900c4b40e2ed21b0684849f789ddb3c6fcaa2d
parent228f324dc718f702e8777164c4e2e7426824fb13
KVM: selftests: Add missing close and munmap in __vm_mem_region_delete()

Deleting a memslot (when freeing a VM) is not closing the backing fd,
nor it's unmapping the alias mapping. Fix by adding the missing close
and munmap.

Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Reviewed-by: Oliver Upton <oupton@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Signed-off-by: Ricardo Koller <ricarkol@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221017195834.2295901-4-ricarkol@google.com
tools/testing/selftests/kvm/lib/kvm_util.c