PM: Fix oops in suspend/hibernate code related to failing ioremap()
When ioremap() fails (which might happen for some reason), we nicely oops in suspend_nvs_save() due to NULL dereference by memcpy() in there. Fail gracefully instead. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
@@ -124,8 +124,7 @@ static int acpi_pm_freeze(void)
|
||||
static int acpi_pm_pre_suspend(void)
|
||||
{
|
||||
acpi_pm_freeze();
|
||||
suspend_nvs_save();
|
||||
return 0;
|
||||
return suspend_nvs_save();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +150,7 @@ static int acpi_pm_prepare(void)
|
||||
{
|
||||
int error = __acpi_pm_prepare();
|
||||
if (!error)
|
||||
acpi_pm_pre_suspend();
|
||||
error = acpi_pm_pre_suspend();
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user