From ce2ca4661aefc9aa006943e73b6ef7bcb18325ef Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 8 Dec 2011 15:32:09 +1100 Subject: [PATCH] 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 --- arch/x86/platform/olpc/olpc-xo15-sci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5