]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/BdsLib/BdsLinuxLoader.c
ArmPkg/BdsLib: InitrdImageSize was not initialized when no initrd was
[mirror_edk2.git] / ArmPkg / Library / BdsLib / BdsLinuxLoader.c
index 2b42b28ff4094e46182413a73116db4ecab59220..ce4b2a43b66aaa0dbbac7e7d79a281fb6803db4e 100644 (file)
@@ -218,11 +218,14 @@ BdsBootLinux (
   UINT32                KernelParamsSize;
   EFI_PHYSICAL_ADDRESS  KernelParamsAddress;
   UINT32                MachineType;
-  BOOLEAN               FdtSupported = FALSE;
+  BOOLEAN               FdtSupported;
   LINUX_KERNEL          LinuxKernel;
   EFI_PHYSICAL_ADDRESS  LinuxImage;
   EFI_PHYSICAL_ADDRESS  InitrdImage;
 
+  InitrdImageSize = 0;
+  FdtSupported = FALSE;
+       
   // Ensure the System Memory PCDs have been initialized (PcdSystemMemoryBase and PcdSystemMemorySize)
   ASSERT (PcdGet32(PcdSystemMemorySize) != 0);
 
@@ -238,7 +241,6 @@ BdsBootLinux (
   LinuxKernel = (LINUX_KERNEL)(UINTN)LinuxImage;
 
   if (InitrdDevicePath) {
-    InitrdImageSize = 0;
     Status = BdsLoadImage (InitrdDevicePath, AllocateAnyPages, &InitrdImage, &InitrdImageSize);
     if (EFI_ERROR(Status)) {
       Print (L"ERROR: Did not find initrd image.\n");