Files
Wenzong Fan dba3038152 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>
2018-12-03 15:12:41 +08:00
..
2017-10-27 21:57:43 +08:00