[PATCH] sched: fix strncmp operation

From: Hillf Danton
Date: Thu Jan 06 2011 - 07:58:18 EST


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@xxxxxxxxx>
---

--- a/kernel/sched.c 2010-11-01 19:54:12.000000000 +0800
+++ b/kernel/sched.c 2011-01-06 20:52:02.000000000 +0800
@@ -751,7 +751,7 @@ sched_feat_write(struct file *filp, cons
buf[cnt] = 0;
cmp = strstrip(buf);

- if (strncmp(buf, "NO_", 3) == 0) {
+ if (strncmp(cmp, "NO_", 3) == 0) {
neg = 1;
cmp += 3;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/