From: Tao Ma Date: Thu, 8 Nov 2012 13:36:38 +0000 (+0800) Subject: cgroup: set 'start' with the right value in cgroup_path. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=316eb661f125397d46f16f94e3c81ad3dc4c1233;p=linux-beck.git cgroup: set 'start' with the right value in cgroup_path. 'start' is set to buf + buflen and do the '--' immediately. Just set it to 'buf + buflen - 1' directly. Signed-off-by: Tao Ma Signed-off-by: Tejun Heo Cc: Li Zefan --- diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 3070164e2036..998ab5957c6a 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -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;