diff options
author | Pavel Machek <pavel@ucw.cz> | 2005-11-09 00:34:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:55:50 -0500 |
commit | 969e9afd489514252a680914c6d8b9322c713eb4 (patch) | |
tree | c4a5f7961995961e0305344c2f5759a80c3955ff /kernel/power | |
parent | 08de1f0461ad40136e7373cf85e2f3c221a9ad9a (diff) |
[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 <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 18d7d693fbba..6ee2cad530e8 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -167,7 +167,7 @@ static int enter_state(suspend_state_t state) | |||
167 | { | 167 | { |
168 | int error; | 168 | int error; |
169 | 169 | ||
170 | if (pm_ops->valid && !pm_ops->valid(state)) | 170 | if (pm_ops && pm_ops->valid && !pm_ops->valid(state)) |
171 | return -ENODEV; | 171 | return -ENODEV; |
172 | if (down_trylock(&pm_sem)) | 172 | if (down_trylock(&pm_sem)) |
173 | return -EBUSY; | 173 | return -EBUSY; |