Skip to content

Commit

Permalink
PM / Sleep: Fix a mistake in a conditional in autosleep_store()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
arve-android authored and rjwysocki committed May 5, 2012
1 parent 4d7e30d commit 040e5bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 040e5bf

Please sign in to comment.