diff options
author | Hillf Danton <dhillf@gmail.com> | 2011-01-06 20:58:12 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-07 15:55:10 +0100 |
commit | 524429c31b486c05449666b94613f59f729c0a84 (patch) | |
tree | 00d0a06e864c0054cc6764f1afa6887e1281bcb6 /kernel | |
parent | 1c5354de90c900b369e2ebd36c3a065ede29eb93 (diff) | |
download | linux-stable-524429c31b486c05449666b94613f59f729c0a84.tar.gz linux-stable-524429c31b486c05449666b94613f59f729c0a84.tar.bz2 linux-stable-524429c31b486c05449666b94613f59f729c0a84.zip |
sched: Fix strncmp operation
One of the operands, buf, is incorrect, since it is stripped and the
correct address for subsequent string comparing could change if
leading white spaces, if any, are removed from buf.
It is fixed by replacing buf with cmp.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <AANLkTinOPuYsVovrZpbuCCmG5deEyc8WgA_A1RJx_YK7@mail.gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index a8478a217dee..a0eb0941fa84 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -741,7 +741,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf, buf[cnt] = 0; cmp = strstrip(buf); - if (strncmp(buf, "NO_", 3) == 0) { + if (strncmp(cmp, "NO_", 3) == 0) { neg = 1; cmp += 3; } |