vhost: free virtio_net::guest_pages in vhost_backend_cleanup()

guest_pages is being allocated in vhost_setup_mem_table(), reallocated
in add_one_guest_page(), but never freed. This patch fixes a memory
leak.

Change-Id: Ie381c43bafea5cdea2ac9f057c0282044a340dce
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-05-08 09:43:08 -07:00 committed by Jim Harris
parent 13657c7d75
commit 0cf6cc7b54

View File

@ -114,6 +114,10 @@ vhost_backend_cleanup(struct virtio_net *dev)
rte_free(dev->mem);
dev->mem = NULL;
}
free(dev->guest_pages);
dev->guest_pages = NULL;
if (dev->log_addr) {
munmap((void *)(uintptr_t)dev->log_addr, dev->log_size);
dev->log_addr = 0;