summaryrefslogtreecommitdiff
path: root/src/boot/efi
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-12-06 12:57:43 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-12-06 13:10:54 +0900
commitfebe556191c739fb79a22cf742dd447c75e90446 (patch)
treeaafd4e6c30ab4b93fa5dbd6cd70d56a299ec20c9 /src/boot/efi
parent9e406b1141da2d93b73428910f2504850631a3ee (diff)
downloadsystemd-febe556191c739fb79a22cf742dd447c75e90446.tar.gz
boot: fix false maybe-uninitialized warning
Fixes #25641.
Diffstat (limited to 'src/boot/efi')
-rw-r--r--src/boot/efi/boot.c4
-rw-r--r--src/boot/efi/cpio.c2
-rw-r--r--src/boot/efi/secure-boot.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 9a562dcf22..2e657a8bf9 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1550,7 +1550,7 @@ static EFI_STATUS efivar_get_timeout(const char16_t *var, uint32_t *ret_value) {
static void config_load_defaults(Config *config, EFI_FILE *root_dir) {
_cleanup_free_ char *content = NULL;
- UINTN value;
+ UINTN value = 0; /* avoid false maybe-uninitialized warning */
EFI_STATUS err;
assert(root_dir);
@@ -2233,7 +2233,7 @@ static void config_load_xbootldr(
EFI_HANDLE *device) {
_cleanup_(file_closep) EFI_FILE *root_dir = NULL;
- EFI_HANDLE new_device;
+ EFI_HANDLE new_device = NULL; /* avoid false maybe-uninitialized warning */
EFI_STATUS err;
assert(config);
diff --git a/src/boot/efi/cpio.c b/src/boot/efi/cpio.c
index 76e2cd7f4e..79b5d4327b 100644
--- a/src/boot/efi/cpio.c
+++ b/src/boot/efi/cpio.c
@@ -468,7 +468,7 @@ EFI_STATUS pack_cpio(
for (UINTN i = 0; i < n_items; i++) {
_cleanup_free_ char *content = NULL;
- UINTN contentsize;
+ UINTN contentsize = 0; /* avoid false maybe-uninitialized warning */
err = file_read(extra_dir, items[i], 0, 0, &content, &contentsize);
if (err != EFI_SUCCESS) {
diff --git a/src/boot/efi/secure-boot.c b/src/boot/efi/secure-boot.c
index 65457bf423..6212868134 100644
--- a/src/boot/efi/secure-boot.c
+++ b/src/boot/efi/secure-boot.c
@@ -6,7 +6,7 @@
#include "util.h"
bool secure_boot_enabled(void) {
- bool secure;
+ bool secure = false; /* avoid false maybe-uninitialized warning */
EFI_STATUS err;
err = efivar_get_boolean_u8(EFI_GLOBAL_GUID, L"SecureBoot", &secure);