Skip to contentSkip to conversation

cgroup: set 'start' with the right value in cgroup_path.

PATCH In review Tao Ma 2 participants 3 messages Nov 8, 2012

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 cgroup: set 'start' with the right value in cgroup_path.

From: Tao Ma <[email protected]>

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

Cc Tejun Heo <[email protected]>
Cc Li Zefan <[email protected]>
---
 kernel/cgroup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup.c +2 -2
index f24f724..a9f8388 100644
@@ -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;
 
Signature · 1 line
1.7.1
#1 lore raw

Hello,

Quoted 7 lines · Tao Ma

From: Tao Ma <[email protected]>

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

Cc Tejun Heo <[email protected]>
Cc Li Zefan <[email protected]>

You're missing S-O-B. I added it while applying. Please ack if you agree.

Heh, I'm not sure how much of an improvement this is but there's obviously nothing wrong with it either. Applying to cgroup/for-3.8.

Thanks.

Signature · 1 line
tejun
author
#2 lore raw
Quoted 5 lines · Tejun Heo

Hello,

Quoted 2 lines · Tao Ma

From: Tao Ma <[email protected]>

Quoted 8 lines
Quoted 5 lines

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

Cc Tejun Heo <[email protected]>
Cc Li Zefan <[email protected]>

You're missing S-O-B. I added it while applying. Please ack if you agree.

oops, sorry, please add

Thanks
Tao

Quoted 6 lines

Heh, I'm not sure how much of an improvement this is but there's obviously nothing wrong with it either. Applying to cgroup/for-3.8.

Thanks.