From: Andrew Morton Date: Fri, 16 Dec 2011 04:49:28 +0000 (+1100) Subject: x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix X-Git-Tag: next-20111221~2^2~238 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2cd966f2da4d11676c3ea58dab450b2e30bd63b3;p=karo-tx-linux.git x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix fix sscanf checking Cc: "H. Peter Anvin" Cc: Andres Salomon Cc: Daniel Drake Cc: Ingo Molnar Cc: Matthew Garrett Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- diff --git a/arch/x86/platform/olpc/olpc-xo15-sci.c b/arch/x86/platform/olpc/olpc-xo15-sci.c index 649230c6979f..2dd700351e7a 100644 --- a/arch/x86/platform/olpc/olpc-xo15-sci.c +++ b/arch/x86/platform/olpc/olpc-xo15-sci.c @@ -58,7 +58,8 @@ static ssize_t lid_wake_on_close_store(struct kobject *s, const char *buf, size_t n) { unsigned int val; - if (!sscanf(buf, "%u", &val) == 1) + + if (sscanf(buf, "%u", &val) != 1) return -EINVAL; set_lid_wake_behavior(!!val);