Explorar el Código

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 <arve@android.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Arve Hjønnevåg hace 13 años
padre
commit
040e5bf65e
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      kernel/power/main.c

+ 1 - 1
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);