diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-07-15 14:26:13 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-15 14:27:30 +0200 |
commit | 653a3538f865d26350727df25397bee2bacde773 (patch) | |
tree | 4fffb146304f7849406d95bdc71cf9ef4eb757a5 /kernel/power | |
parent | 4320f6b1d9db4ca912c5eb6ecb328b2e090e1586 (diff) | |
download | op-kernel-dev-653a3538f865d26350727df25397bee2bacde773.zip op-kernel-dev-653a3538f865d26350727df25397bee2bacde773.tar.gz |
PM / sleep: fix freeze_ops NULL pointer dereferences
This patch fixes a NULL pointer dereference issue introduced by
commit 1f0b63866fc1 (ACPI / PM: Hold ACPI scan lock over the "freeze"
sleep state).
Fixes: 1f0b63866fc1 (ACPI / PM: Hold ACPI scan lock over the "freeze" sleep state)
Link: http://marc.info/?l=linux-pm&m=140541182017443&w=2
Reported-and-tested-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r-- | kernel/power/suspend.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 4dd8822..ed35a47 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -306,7 +306,7 @@ int suspend_devices_and_enter(suspend_state_t state) error = suspend_ops->begin(state); if (error) goto Close; - } else if (state == PM_SUSPEND_FREEZE && freeze_ops->begin) { + } else if (state == PM_SUSPEND_FREEZE && freeze_ops && freeze_ops->begin) { error = freeze_ops->begin(); if (error) goto Close; @@ -335,7 +335,7 @@ int suspend_devices_and_enter(suspend_state_t state) Close: if (need_suspend_ops(state) && suspend_ops->end) suspend_ops->end(); - else if (state == PM_SUSPEND_FREEZE && freeze_ops->end) + else if (state == PM_SUSPEND_FREEZE && freeze_ops && freeze_ops->end) freeze_ops->end(); return error; |