mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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>
This commit is contained in:
parent
97143b70aa
commit
0800639207
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user