[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1352381798-2357-1-git-send-email-tm@tao.ma>
Date: Thu, 8 Nov 2012 21:36:38 +0800
From: Tao Ma <tm@....ma>
To: linux-kernel@...r.kernel.org
Cc: Tejun Heo <tj@...nel.org>, Li Zefan <lizefan@...wei.com>
Subject: [PATCH] cgroup: set 'start' with the right value in cgroup_path.
From: Tao Ma <boyu.mt@...bao.com>
'start' is set to buf + buflen and do the '--' immediately.
Just set it to 'buf + buflen - 1' directly.
Cc: Tejun Heo <tj@...nel.org>
Cc: Li Zefan <lizefan@...wei.com>
---
kernel/cgroup.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f24f724..a9f8388 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1821,9 +1821,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;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists