From: Andrew Morton Date: Fri, 2 Dec 2011 03:06:53 +0000 (+1100) Subject: x86-olpc-xo15-sci-enable-lid-close-wakeup-control-through-sysfs-fix X-Git-Tag: next-20111202~2^2~218 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5fb0f51b1e383c6bf28c82fe3d094232b76b65e9;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);