projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
97143b7
)
vhost/test: fix memory leak of vhost virtqueues
author
Xianting Tian
<xianting.tian@linux.alibaba.com>
Tue, 28 Dec 2021 03:09:24 +0000
(11:09 +0800)
committer
Michael S. Tsirkin
<mst@redhat.com>
Fri, 14 Jan 2022 23:50:53 +0000
(18:50 -0500)
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>
drivers/vhost/test.c
patch
|
blob
|
history
diff --git
a/drivers/vhost/test.c
b/drivers/vhost/test.c
index a09dedc79f68202796972792fb98a2d74e0d697a..05740cba1cd89e53b2c166cede16e384f8182fdd 100644
(file)
--- 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;
}