diff options
author | Bo Liu <liubo03@inspur.com> | 2022-08-05 05:12:54 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2022-08-11 04:26:09 -0400 |
commit | ebe6a354fa7e0a7d5b581da31ad031b19d8693f9 (patch) | |
tree | 7c43fb202034a64a3fd3e1a511217ae2ee133510 /drivers/vhost/vdpa.c | |
parent | 79e0034cb3485e64622ec0aabf8a6f4f8143f47b (diff) |
vhost-vdpa: Call ida_simple_remove() when failed
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>
Diffstat (limited to 'drivers/vhost/vdpa.c')
-rw-r--r-- | drivers/vhost/vdpa.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 250ad4160ccb..2c997d77d266 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -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; } |