]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
vhost-vdpa: Call ida_simple_remove() when failed
authorBo Liu <liubo03@inspur.com>
Fri, 5 Aug 2022 09:12:54 +0000 (05:12 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 11 Aug 2022 08:26:09 +0000 (04:26 -0400)
In function vhost_vdpa_probe(), when code execution fails, we should
call ida_simple_remove() to free ida.

Signed-off-by: Bo Liu <liubo03@inspur.com>
Message-Id: <20220805091254.20026-1-liubo03@inspur.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vdpa.c

index 250ad4160ccb28212b16b4da91aa8377c27a9192..2c997d77d2663871ae28056a959af791a41a610b 100644 (file)
@@ -1363,6 +1363,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
 
 err:
        put_device(&v->dev);
+       ida_simple_remove(&vhost_vdpa_ida, v->minor);
        return r;
 }