From: Hillf Danton Date: Thu, 6 Jan 2011 12:58:12 +0000 (+0800) Subject: sched: Fix strncmp operation X-Git-Tag: upstream/snapshot3+hdmi~11652^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=524429c31b486c05449666b94613f59f729c0a84;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Peter Zijlstra LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched.c b/kernel/sched.c index a8478a2..a0eb094 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; }