diff options
author | Xianting Tian <xianting.tian@linux.alibaba.com> | 2021-12-28 04:09:24 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-01-15 00:50:53 +0100 |
commit | 080063920777af65105e5953e2851e036376e3ea (patch) | |
tree | d24d7534462d4fc56460e0786a156addaec3d2e0 | |
parent | vdpa/mlx5: Fix wrong configuration of virtio_version_1_0 (diff) | |
download | linux-080063920777af65105e5953e2851e036376e3ea.tar.xz linux-080063920777af65105e5953e2851e036376e3ea.zip |
vhost/test: fix memory leak of vhost virtqueues
We need free the vqs in .release(), which are allocated in .open().
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Link: https://lore.kernel.org/r/20211228030924.3468439-1-xianting.tian@linux.alibaba.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
-rw-r--r-- | drivers/vhost/test.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index a09dedc79f68..05740cba1cd8 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -166,6 +166,7 @@ static int vhost_test_release(struct inode *inode, struct file *f) /* We do an extra flush before freeing memory, * since jobs can re-queue themselves. */ vhost_test_flush(n); + kfree(n->dev.vqs); kfree(n); return 0; } |