Commit 37787e9f authored by Mike Christie's avatar Mike Christie Committed by Michael S. Tsirkin
Browse files

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: default avatarMike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/1600712588-9514-2-git-send-email-michael.christie@oracle.com


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent a127c5bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;