From 92f86bff088dc6f0c0ed93b8e82d4d2459c35145 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 13 Mar 2018 11:17:29 -0600 Subject: vfio/common: cleanup in vfio_region_finalize Signed-off-by: Gerd Hoffmann Reviewed by: Kirti Wankhede Signed-off-by: Alex Williamson --- hw/vfio/common.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/vfio') diff --git a/hw/vfio/common.c b/hw/vfio/common.c index f895e3c..6a8203a 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -858,6 +858,13 @@ void vfio_region_finalize(VFIORegion *region) g_free(region->mmaps); trace_vfio_region_finalize(region->vbasedev->name, region->nr); + + region->mem = NULL; + region->mmaps = NULL; + region->nr_mmaps = 0; + region->size = 0; + region->flags = 0; + region->nr = 0; } void vfio_region_mmaps_set_enabled(VFIORegion *region, bool enabled) -- cgit v1.1