From: Pavel Machek Date: Wed, 9 Nov 2005 05:34:30 +0000 (-0800) Subject: [PATCH] sleep: Fix oops in enter_state X-Git-Tag: v2.6.15-rc1~394 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=969e9afd489514252a680914c6d8b9322c713eb4;p=linux-2.6 [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/power/main.c b/kernel/power/main.c index 18d7d693fb..6ee2cad530 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -167,7 +167,7 @@ static int enter_state(suspend_state_t state) { 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;