Skip to content

Commit

Permalink
vhost-vdpa: Call ida_simple_remove() when failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bo Liu authored and Michael S. Tsirkin committed Aug 11, 2022
1 parent 79e0034 commit ebe6a35
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/vhost/vdpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ebe6a35

Please sign in to comment.