Skip to content

Commit 37787e9

Browse files
mikechristiemstsirkin
authored andcommitted
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 <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>
1 parent a127c5b commit 37787e9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/vhost/vdpa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
810810

811811
err_init_iotlb:
812812
vhost_dev_cleanup(&v->vdev);
813+
kfree(vqs);
813814
err:
814815
atomic_dec(&v->opened);
815816
return r;

0 commit comments

Comments
 (0)