Blob Blame History Raw
From: Bo Liu <liubo03@inspur.com>
Date: Fri, 5 Aug 2022 05:12:54 -0400
Subject: vhost-vdpa: Call ida_simple_remove() when failed
Patch-mainline: v6.0-rc1
Git-commit: ebe6a354fa7e0a7d5b581da31ad031b19d8693f9
References: jsc#PED-1549

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/vhost/vdpa.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -1363,6 +1363,7 @@ static int vhost_vdpa_probe(struct vdpa_
 
 err:
 	put_device(&v->dev);
+	ida_simple_remove(&vhost_vdpa_ida, v->minor);
 	return r;
 }