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

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.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
parent a127c5bb
...@@ -810,6 +810,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep) ...@@ -810,6 +810,7 @@ static int vhost_vdpa_open(struct inode *inode, struct file *filep)
err_init_iotlb: err_init_iotlb:
vhost_dev_cleanup(&v->vdev); vhost_dev_cleanup(&v->vdev);
kfree(vqs);
err: err:
atomic_dec(&v->opened); atomic_dec(&v->opened);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment