ACRN:DM: Free virtio_vsock struct resource in deinit function

Free the virtio_vsock struct resource in virtio vsock deinit function
in case memory leak.

Tracked-On: #7759
Signed-off-by: Liu Long <long.liu@linux.intel.com>
This commit is contained in:
Liu Long 2022-07-27 00:20:14 +08:00 committed by acrnsi-robot
parent 6e18d2bd8f
commit 73c529a903
1 changed files with 1 additions and 0 deletions

View File

@ -322,6 +322,7 @@ virtio_vhost_vsock_deinit(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
if (vsock->vhost_vsock)
vhost_vsock_deinit(vsock->vhost_vsock);
pr_dbg("%s: done\n", __func__);
free(vsock);
} else
pr_err("%s: NULL.\n", __func__);
}