Skip to content

Commit

Permalink
cgroup: fix error return value from cgroup_subtree_control()
Browse files Browse the repository at this point in the history
While refactoring, f7b2814 ("cgroup: factor out
cgroup_{apply|finalize}_control() from
cgroup_subtree_control_write()") broke error return value from the
function.  The return value from the last operation is always
overridden to zero.  Fix it.

Signed-off-by: Tejun Heo <[email protected]>
Cc: [email protected] # v4.6+
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
htejun committed Jul 23, 2017
1 parent 7af608e commit 3c74541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -3001,11 +3001,11 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
cgrp->subtree_control &= ~disable;

ret = cgroup_apply_control(cgrp);

cgroup_finalize_control(cgrp, ret);
if (ret)
goto out_unlock;

kernfs_activate(cgrp->kn);
ret = 0;
out_unlock:
cgroup_kn_unlock(of->kn);
return ret ?: nbytes;
Expand Down

0 comments on commit 3c74541

Please sign in to comment.