]> Git Repo - linux.git/commitdiff
sched: Fix strncmp operation
authorHillf Danton <[email protected]>
Thu, 6 Jan 2011 12:58:12 +0000 (20:58 +0800)
committerIngo Molnar <[email protected]>
Fri, 7 Jan 2011 14:55:10 +0000 (15:55 +0100)
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 <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched.c

index a8478a217deeb980505896191cc32734f9545dbf..a0eb0941fa84a1e1b194ac8d4e071aaec82183fb 100644 (file)
@@ -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;
        }
This page took 0.060588 seconds and 4 git commands to generate.