From: Arve Hjønnevåg Date: Thu, 3 May 2012 22:14:21 +0000 (+0200) Subject: PM / Sleep: Fix a mistake in a conditional in autosleep_store() X-Git-Tag: v3.5-rc1~116^2~3^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=040e5bf65e1ee66266bc314c5965518a7c21ff36;p=karo-tx-linux.git PM / Sleep: Fix a mistake in a conditional in autosleep_store() The condition check in autosleep_store() is incorrect and prevents /sys/power/autosleep from working as advertised. Fix that. [rjw: Added the changelog.] Signed-off-by: Arve Hjønnevåg Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/main.c b/kernel/power/main.c index 54ec071de337..428f8a034e96 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -422,7 +422,7 @@ static ssize_t autosleep_store(struct kobject *kobj, int error; if (state == PM_SUSPEND_ON - && !(strncmp(buf, "off", 3) && strncmp(buf, "off\n", 4))) + && strcmp(buf, "off") && strcmp(buf, "off\n")) return -EINVAL; error = pm_autosleep_set_state(state);