Skip to contentSkip to conversation

sleep: Fix oops in enter_state

PATCH New Pavel Machek 1 participant 1 message Nov 8, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

kernel/power/main.c +1 -1
@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t s
 {
 	int error;
 
-	if (pm_ops->valid && !pm_ops->valid(state))
+	if (pm_ops && pm_ops->valid && !pm_ops->valid(state))
 		return -ENODEV;
 	if (down_trylock(&pm_sem))
 		return -EBUSY;
Signature · 1 line
Thanks, Sharp!