From: Mike Yuan Date: Sun, 13 Aug 2023 14:59:30 +0000 (+0800) Subject: sleep: clear EFI HibernateLocation if writing kernel config fails X-Git-Tag: v255-rc1~732 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=031a399d87de5a47d395bb12b70e112c83b02c3f;p=thirdparty%2Fsystemd.git sleep: clear EFI HibernateLocation if writing kernel config fails Follow-up for f1f331a252d22c15f37d03524cce967664358c5c --- diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index de1f6c7ec1f..76b69f817ae 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -270,8 +270,12 @@ static int execute( return r; r = write_kernel_hibernate_location(hibernate_location); - if (r < 0) + if (r < 0) { + if (is_efi_boot()) + (void) efi_set_variable(EFI_SYSTEMD_VARIABLE(HibernateLocation), NULL, 0); + return log_error_errno(r, "Failed to prepare for hibernation: %m"); + } } r = write_mode(modes);