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>
This commit is contained in:
Mike Christie 2020-09-21 13:23:01 -05:00 committed by Michael S. Tsirkin
parent a127c5bbb6
commit 37787e9f81
1 changed files with 1 additions and 0 deletions

View File

@ -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;