aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-07-07 17:43:45 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2010-07-18 20:00:35 -0400
commitce4410116c5debfb0e049f5db4b5cd6211e05b80 (patch)
tree510009c78c5d2757fde08f31c03dd41ddb130463 /include/linux/suspend.h
parentd074ee023fa3a4681b64223c5e636102c39628c4 (diff)
PM / Suspend: Fix ordering of calls in suspend error paths
The ACPI suspend code calls suspend_nvs_free() at a wrong place, which may lead to a memory leak if there's an error executing acpi_pm_prepare(), because acpi_pm_finish() will not be called in that case. However, the root cause of this problem is the apparently confusing ordering of calls in suspend error paths that needs to be fixed. In addition to that, fix a typo in a label name in suspend.c. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index bf1bab7b059c..4af270ec2204 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -61,14 +61,15 @@ typedef int __bitwise suspend_state_t;
61 * before device drivers' late suspend callbacks are executed. It returns 61 * before device drivers' late suspend callbacks are executed. It returns
62 * 0 on success or a negative error code otherwise, in which case the 62 * 0 on success or a negative error code otherwise, in which case the
63 * system cannot enter the desired sleep state (@prepare_late(), @enter(), 63 * system cannot enter the desired sleep state (@prepare_late(), @enter(),
64 * @wake(), and @finish() will not be called in that case). 64 * and @wake() will not be called in that case).
65 * 65 *
66 * @prepare_late: Finish preparing the platform for entering the system sleep 66 * @prepare_late: Finish preparing the platform for entering the system sleep
67 * state indicated by @begin(). 67 * state indicated by @begin().
68 * @prepare_late is called before disabling nonboot CPUs and after 68 * @prepare_late is called before disabling nonboot CPUs and after
69 * device drivers' late suspend callbacks have been executed. It returns 69 * device drivers' late suspend callbacks have been executed. It returns
70 * 0 on success or a negative error code otherwise, in which case the 70 * 0 on success or a negative error code otherwise, in which case the
71 * system cannot enter the desired sleep state (@enter() and @wake()). 71 * system cannot enter the desired sleep state (@enter() will not be
72 * executed).
72 * 73 *
73 * @enter: Enter the system sleep state indicated by @begin() or represented by 74 * @enter: Enter the system sleep state indicated by @begin() or represented by
74 * the argument if @begin() is not implemented. 75 * the argument if @begin() is not implemented.
@@ -81,14 +82,15 @@ typedef int __bitwise suspend_state_t;
81 * resume callbacks are executed. 82 * resume callbacks are executed.
82 * This callback is optional, but should be implemented by the platforms 83 * This callback is optional, but should be implemented by the platforms
83 * that implement @prepare_late(). If implemented, it is always called 84 * that implement @prepare_late(). If implemented, it is always called
84 * after @enter(), even if @enter() fails. 85 * after @prepare_late and @enter(), even if one of them fails.
85 * 86 *
86 * @finish: Finish wake-up of the platform. 87 * @finish: Finish wake-up of the platform.
87 * @finish is called right prior to calling device drivers' regular suspend 88 * @finish is called right prior to calling device drivers' regular suspend
88 * callbacks. 89 * callbacks.
89 * This callback is optional, but should be implemented by the platforms 90 * This callback is optional, but should be implemented by the platforms
90 * that implement @prepare(). If implemented, it is always called after 91 * that implement @prepare(). If implemented, it is always called after
91 * @enter() and @wake(), if implemented, even if any of them fails. 92 * @enter() and @wake(), even if any of them fails. It is executed after
93 * a failing @prepare.
92 * 94 *
93 * @end: Called by the PM core right after resuming devices, to indicate to 95 * @end: Called by the PM core right after resuming devices, to indicate to
94 * the platform that the system has returned to the working state or 96 * the platform that the system has returned to the working state or