lkml.org 
[lkml]   [2012]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cgroup: set 'start' with the right value in cgroup_path.
Date
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


\
 
 \ /
  Last update: 2012-11-08 15:21    [W:0.154 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site