Skip to content

Commit

Permalink
vhost vdpa: fix vhost_vdpa_open error handling
Browse files Browse the repository at this point in the history
We must free the vqs array in the open failure path, because
vhost_vdpa_release will not be called.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/1600712588-9514-2-git-send-email-michael.christie@oracle.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
  • Loading branch information
mikechristie authored and mstsirkin committed Sep 30, 2020
1 parent a127c5b commit 37787e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/vhost/vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 37787e9

Please sign in to comment.