]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Fix calls to ResetSystem
authorJan Janssen <medhefgo@web.de>
Thu, 23 Jun 2022 12:48:13 +0000 (14:48 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Jun 2022 16:41:35 +0000 (18:41 +0200)
gnu-efi falsely declares a return type for ResetSystem when it should be
void. The spec also says that it never returns, so just assert.

src/boot/efi/boot.c

index ea80c1875dd5b9cf6ae12b616b697af8b107da98..0d472b0386dc2cc2247333b9ccf8c6dc72a7e305 100644 (file)
@@ -593,8 +593,8 @@ static EFI_STATUS reboot_into_firmware(void) {
         if (EFI_ERROR(err))
                 return log_error_status_stall(err, L"Error setting OsIndications: %r", err);
 
-        err = RT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
-        return log_error_status_stall(err, L"Error calling ResetSystem: %r", err);
+        RT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
+        assert_not_reached();
 }
 
 static BOOLEAN menu_run(
@@ -1986,7 +1986,8 @@ static EFI_STATUS boot_windows_bitlocker(void) {
                                 EFI_VARIABLE_NON_VOLATILE);
                         if (EFI_ERROR(err))
                                 return err;
-                        return RT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
+                        RT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
+                        assert_not_reached();
                 }
         }