From: Mike Christie Date: Mon, 21 Sep 2020 18:23:01 +0000 (-0500) Subject: vhost vdpa: fix vhost_vdpa_open error handling X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=37787e9f81e2e586b526ff5c29c94e4f41513e80;p=linux.git 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 Link: https://lore.kernel.org/r/1600712588-9514-2-git-send-email-michael.christie@oracle.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang --- diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 796fe979f997f..9a48439c52e2b 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -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;