aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Christie <[email protected]>2020-09-21 13:23:01 -0500
committerMichael S. Tsirkin <[email protected]>2020-09-30 11:25:06 -0400
commit37787e9f81e2e586b526ff5c29c94e4f41513e80 (patch)
treee0de7f0adee27b2d89b286e0e1342523c09ecb97
parenta127c5bbb6a8eee851cbdec254424c480b8edd75 (diff)
vhost vdpa: fix vhost_vdpa_open error handling
We must free the vqs array in the open failure path, because vhost_vdpa_release will not be called. Signed-off-by: Mike Christie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
-rw-r--r--drivers/vhost/vdpa.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 796fe979f997..9a48439c52e2 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -810,6 +810,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
err_init_iotlb:
vhost_dev_cleanup(&v->vdev);
+ kfree(vqs);
err:
atomic_dec(&v->opened);
return r;