PM: hibernate: Propagate the return value of hibernation_restore()
authorDexuan Cui <decui@microsoft.com>
Tue, 31 Mar 2020 15:55:25 +0000 (08:55 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 1 Apr 2020 09:36:11 +0000 (11:36 +0200)
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>
kernel/power/hibernate.c

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