]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/FileSystem/BootMonFs/BootMonFsOpenClose.c
ArmPlatformPkg/BootMonFs: Fix finding space for new files
[mirror_edk2.git] / ArmPlatformPkg / FileSystem / BootMonFs / BootMonFsOpenClose.c
index 778af389a0088cb0bc97d0e0030498e60ed14662..1b5cc48937683ae0adb0e0363fdc130f95903e04 100644 (file)
@@ -204,6 +204,11 @@ BootMonFsFindSpaceForNewFile (
          )\r
   {\r
     FileEntry = BOOTMON_FS_FILE_FROM_LINK_THIS (FileLink);\r
+    // Skip files that aren't on disk yet\r
+    if (FileEntry->HwDescription.RegionCount == 0) {\r
+      continue;\r
+    }\r
+\r
     // If the free space preceding the file is big enough to contain the new\r
     // file then use it!\r
     if (((FileEntry->HwDescription.BlockStart * BlockSize) - *FileStart)\r