提交 f95642a3 编写于 作者: B Bo Liu 提交者: Pengyuan Zhao

vhost-vdpa: Call ida_simple_remove() when failed

mainline inclusion
from mainline-v6.0-rc1
commit ebe6a354
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebe6a354fa7e0a7d5b581da31ad031b19d8693f9

----------------------------------------------------------------------

In function vhost_vdpa_probe(), when code execution fails, we should
call ida_simple_remove() to free ida.
Signed-off-by: NBo Liu <liubo03@inspur.com>
Message-Id: <20220805091254.20026-1-liubo03@inspur.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NPengyuan Zhao <zhaopengyuan@hisilicon.com>
上级 f24ba014
...@@ -1367,6 +1367,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa) ...@@ -1367,6 +1367,7 @@ static int vhost_vdpa_probe(struct vdpa_device *vdpa)
err: err:
put_device(&v->dev); put_device(&v->dev);
ida_simple_remove(&vhost_vdpa_ida, v->minor);
return r; return r;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册