From 1805da6cd6c4ac25c24fc468b071b5a671d000b2 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 2 Dec 2011 14:06:53 +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