Re: [PATCH] PM: hibernate: Preserve error status in create_image()
From: Rafael J. Wysocki
Date: Mon Jun 01 2026 - 15:17:31 EST
On Mon, Jun 1, 2026 at 8:57 PM Lenny Szubowicz <lszubowi@xxxxxxxxxx> wrote:
>
> Prevent hibernation errors that are encountered in create_image()
> from being overwritten by a success from arch_resume_nosmt() on
> the routine exit cleanup path.
>
> Fixes: ec527c318036 ("x86/power: Fix 'nosmt' vs hibernation triple fault during resume")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lenny Szubowicz <lszubowi@xxxxxxxxxx>
> ---
> kernel/power/hibernate.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index af8d07bafe02..2e837a9c617b 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -324,6 +324,7 @@ __weak int arch_resume_nosmt(void)
> static int create_image(int platform_mode)
> {
> int error;
> + int nosmt_err;
>
> error = dpm_suspend_end(PMSG_FREEZE);
> if (error) {
> @@ -380,8 +381,11 @@ static int create_image(int platform_mode)
> pm_sleep_enable_secondary_cpus();
>
> /* Allow architectures to do nosmt-specific post-resume dances */
> - if (!in_suspend)
> - error = arch_resume_nosmt();
But in the cleanup path, in_suspend is not supposed to be set.
If it is set there, then that is the bug to address.
> + if (!in_suspend) {
> + nosmt_err = arch_resume_nosmt();
> + if (!error)
> + error = nosmt_err;
> + }
>
> Platform_finish:
> platform_finish(platform_mode);
> --