Skip to content

Commit 969e9af

Browse files
pavelmachekLinus Torvalds
authored and
Linus Torvalds
committed
[PATCH] sleep: Fix oops in enter_state
If ACPI sleep is not configured, but someone still wants to run swsusp, he'd get oops in enter_state. This is regression since 2.6.14 and this fixes it. Signed-off-by: Pavel Machek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 08de1f0 commit 969e9af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/power/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t state)
167167
{
168168
int error;
169169

170-
if (pm_ops->valid && !pm_ops->valid(state))
170+
if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
171171
return -ENODEV;
172172
if (down_trylock(&pm_sem))
173173
return -EBUSY;

0 commit comments

Comments
 (0)