Skip to content

Commit

Permalink
cgroup: set 'start' with the right value in cgroup_path.
Browse files Browse the repository at this point in the history
'start' is set to buf + buflen and do the '--' immediately.
Just set it to 'buf + buflen - 1' directly.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
  • Loading branch information
Tao Ma authored and Tejun Heo committed Nov 8, 2012
1 parent 4b1c784 commit 316eb66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,9 +1770,9 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
return 0;
}

start = buf + buflen;
start = buf + buflen - 1;

*--start = '\0';
*start = '\0';
for (;;) {
int len = dentry->d_name.len;

Expand Down

0 comments on commit 316eb66

Please sign in to comment.