Re: [PATCH] PM: hibernate: Propagate the return value of hibernation_restore()
From: Rafael J. Wysocki
Date: Wed Apr 01 2020 - 05:37:46 EST
On Tue, Mar 31, 2020 at 5:56 PM Dexuan Cui <decui@xxxxxxxxxxxxx> wrote:
>
> If hibernation_restore() fails, the 'error' should not be zero.
>
> Signed-off-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
> ---
> kernel/power/hibernate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 6dbeedb..86aba87 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -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();
> --
Applied as 5.7-rc material, thanks!