All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: set 'start' with the right value in cgroup_path.
@ 2012-11-08 13:36 Tao Ma
  2012-11-08 14:24 ` Tejun Heo
  0 siblings, 1 reply; 3+ messages in thread
From: Tao Ma @ 2012-11-08 13:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tejun Heo, Li Zefan

From: Tao Ma <boyu.mt@taobao.com>

'start' is set to buf + buflen and do the '--' immediately.
Just set it to 'buf + buflen - 1' directly.

Cc: Tejun Heo <tj@kernel.org>
Cc: Li Zefan <lizefan@huawei.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-08 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 13:36 [PATCH] cgroup: set 'start' with the right value in cgroup_path Tao Ma
2012-11-08 14:24 ` Tejun Heo
2012-11-08 14:31   ` Tao Ma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.