Skip to content

Commit

Permalink
ACPI / Sleep: Free NVS copy if suspending of devices fails
Browse files Browse the repository at this point in the history
If suspending of devices fails or system suspend is tested in the
"devices" mode, the memory allocated for storing a copy of the ACPI
NVS area will not be freed, because acpi_pm_finish() is not called
in that case.  Fix this by moving the suspend_nvs_free() call to
acpi_pm_end().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Rafael J. Wysocki authored and Len Brown committed Jul 6, 2010
1 parent 815c416 commit e96c4b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ static void acpi_pm_finish(void)
{
u32 acpi_state = acpi_target_sleep_state;

suspend_nvs_free();
acpi_ec_unblock_transactions();

if (acpi_state == ACPI_STATE_S0)
Expand All @@ -167,6 +166,7 @@ static void acpi_pm_finish(void)
*/
static void acpi_pm_end(void)
{
suspend_nvs_free();
/*
* This is necessary in case acpi_pm_finish() is not called during a
* failing transition to a sleep state.
Expand Down

0 comments on commit e96c4b0

Please sign in to comment.