diff options
author | MyungJoo Ham <myungjoo.ham@samsung.com> | 2010-11-26 17:07:48 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2010-12-24 09:02:40 -0500 |
commit | 5729c63a51f0f8a351e0f1dc7b3250ebac12c309 (patch) | |
tree | 739030dfbc26519ec7fd813d797f9865678df11d | |
parent | 8cfe400ca54fd1ed96f962bea5f7e20b09b6d69f (diff) |
PM / Hibernate: hibernation_ops->leave should be checked too
Because hibernate calls hibernation_ops->leave() without checking
whether hibernation_ops->leave is NULL or not, hiberantion_set_ops
should WARN_ON if hibernation_ops->leave is NULL.
This patch added one more condition to check hibernation_ops->leave.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r-- | kernel/power/hibernate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 048d0b514831..ab2836c25038 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -62,7 +62,7 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops) | |||
62 | { | 62 | { |
63 | if (ops && !(ops->begin && ops->end && ops->pre_snapshot | 63 | if (ops && !(ops->begin && ops->end && ops->pre_snapshot |
64 | && ops->prepare && ops->finish && ops->enter && ops->pre_restore | 64 | && ops->prepare && ops->finish && ops->enter && ops->pre_restore |
65 | && ops->restore_cleanup)) { | 65 | && ops->restore_cleanup && ops->leave)) { |
66 | WARN_ON(1); | 66 | WARN_ON(1); |
67 | return; | 67 | return; |
68 | } | 68 | } |