Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arve Hjønnevåg and committed by
Rafael J. Wysocki
040e5bf6 4d7e30d9

+1 -1
+1 -1
kernel/power/main.c
··· 422 422 int error; 423 423 424 424 if (state == PM_SUSPEND_ON 425 - && !(strncmp(buf, "off", 3) && strncmp(buf, "off\n", 4))) 425 + && strcmp(buf, "off") && strcmp(buf, "off\n")) 426 426 return -EINVAL; 427 427 428 428 error = pm_autosleep_set_state(state);