diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2018-01-30 08:42:03 +0000 |
---|---|---|
committer | Jia Zhang <zhang.jia@linux.alibaba.com> | 2018-12-03 15:12:41 +0800 |
commit | dba30381528fcf50ac50b15461b00c4f0a280d78 (patch) | |
tree | ecda4ed282cd8d40e62ca13033edff7adb81e707 | |
parent | 22bd7aa878adfc8f7b6c12bc92e441fa3b161e2c (diff) | |
download | meta-secure-core-dba30381528fcf50ac50b15461b00c4f0a280d78.tar.gz |
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 <wenzong.fan@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
-rw-r--r-- | meta-efi-secure-boot/recipes-bsp/grub/grub-efi/mok2verify-support-to-verify-non-PE-file-with-PKCS-7.patch | 2 |
1 files changed, 1 insertions, 1 deletions
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 | |||
451 | int newc = 0; | 451 | int newc = 0; |
452 | struct dir *root = 0; | 452 | struct dir *root = 0; |
453 | grub_ssize_t cursize = 0; | 453 | grub_ssize_t cursize = 0; |
454 | + grub_err_t err; | 454 | + grub_err_t err = GRUB_ERR_NONE; |
455 | 455 | ||
456 | for (i = 0; i < initrd_ctx->nfiles; i++) | 456 | for (i = 0; i < initrd_ctx->nfiles; i++) |
457 | { | 457 | { |