cgroup: fix error return value in cgroup_mount()
When cgroup_mount() fails to allocate an id for the root, it didn't set ret before jumping to unlock_drop ending up returning 0 after a failure. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
ab3f5faa62
commit
eb46bf8969
1 changed files with 3 additions and 3 deletions
|
@ -1566,10 +1566,10 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
|
||||||
mutex_lock(&cgroup_mutex);
|
mutex_lock(&cgroup_mutex);
|
||||||
mutex_lock(&cgroup_root_mutex);
|
mutex_lock(&cgroup_root_mutex);
|
||||||
|
|
||||||
root_cgrp->id = idr_alloc(&root->cgroup_idr, root_cgrp,
|
ret = idr_alloc(&root->cgroup_idr, root_cgrp, 0, 1, GFP_KERNEL);
|
||||||
0, 1, GFP_KERNEL);
|
if (ret < 0)
|
||||||
if (root_cgrp->id < 0)
|
|
||||||
goto unlock_drop;
|
goto unlock_drop;
|
||||||
|
root_cgrp->id = ret;
|
||||||
|
|
||||||
/* Check for name clashes with existing mounts */
|
/* Check for name clashes with existing mounts */
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
|
|
Loading…
Reference in a new issue