PM: hibernate: Propagate the return value of hibernation_restore()

If hibernation_restore() fails, the 'error' should not be zero.

Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Dexuan Cui 2020-03-31 08:55:25 -07:00 committed by Rafael J. Wysocki
parent 2ce94bc4e0
commit 3704a6a445

View File

@ -678,7 +678,7 @@ static int load_image_and_restore(void)
error = swsusp_read(&flags); error = swsusp_read(&flags);
swsusp_close(FMODE_READ); swsusp_close(FMODE_READ);
if (!error) if (!error)
hibernation_restore(flags & SF_PLATFORM_MODE); error = hibernation_restore(flags & SF_PLATFORM_MODE);
pr_err("Failed to load image, recovering.\n"); pr_err("Failed to load image, recovering.\n");
swsusp_free(); swsusp_free();