From dba30381528fcf50ac50b15461b00c4f0a280d78 Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Tue, 30 Jan 2018 08:42:03 +0000 Subject: grub-efi: fix the potential uninitialized error for variable 'err' Fix the build errors with DEBUG_BUILD enabled: grub-core/loader/linux.c: In function 'grub_initrd_load': grub-core/loader/linux.c:326:10: error: 'err' may be used \ uninitialized in this function [-Werror=maybe-uninitialized] In function grub_initrd_load: grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx, char *argv[], void *target) { [snip] grub_err_t err; [snip] #ifdef GRUB_MACHINE_EFI [snip] err = grub_verify_file (argv[i]); [snip] #endif [snip] fail: [snip] return err; } If the GRUB_MACHINE_EFI is not defined, the function would return an uninitialized value for 'err'. We should initialize it when this variable is assigned. Signed-off-by: Wenzong Fan Signed-off-by: Yi Zhao --- .../grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta-efi-secure-boot') diff --git a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch index f03e772..8a0588d 100644 --- a/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch +++ b/meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch @@ -451,7 +451,7 @@ index be6fa0f..edc6d24 100644 int newc = 0; struct dir *root = 0; grub_ssize_t cursize = 0; -+ grub_err_t err; ++ grub_err_t err = GRUB_ERR_NONE; for (i = 0; i < initrd_ctx->nfiles; i++) { -- cgit v1.2.3-54-g00ecf