* [PATCH] PM: hibernate: Propagate the return value of hibernation_restore()
@ 2020-03-31 15:55 Dexuan Cui
2020-04-01 9:37 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Dexuan Cui @ 2020-03-31 15:55 UTC (permalink / raw)
To: rjw, len.brown, pavel, linux-pm, linux-kernel, decui
If hibernation_restore() fails, the 'error' should not be zero.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
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();
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PM: hibernate: Propagate the return value of hibernation_restore()
2020-03-31 15:55 [PATCH] PM: hibernate: Propagate the return value of hibernation_restore() Dexuan Cui
@ 2020-04-01 9:37 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-04-01 9:37 UTC (permalink / raw)
To: Dexuan Cui
Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM,
Linux Kernel Mailing List
On Tue, Mar 31, 2020 at 5:56 PM Dexuan Cui <decui@microsoft.com> wrote:
>
> If hibernation_restore() fails, the 'error' should not be zero.
>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> ---
> 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!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-01 9:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 15:55 [PATCH] PM: hibernate: Propagate the return value of hibernation_restore() Dexuan Cui
2020-04-01 9:37 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).