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-Url: https://git.stricted.de/?a=commitdiff_plain;h=040e5bf65e1ee66266bc314c5965518a7c21ff36;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.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 54ec071de33..428f8a034e9 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);