aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--boot/bootmeth_efi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index bceec0d12e..1c9f2b1e2f 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -21,6 +21,7 @@
#include <mmc.h>
#include <net.h>
#include <pxe_utils.h>
+#include <linux/sizes.h>
#define EFI_DIRNAME "efi/boot/"
@@ -281,9 +282,12 @@ static int distro_efi_try_bootflow_files(struct udevice *dev,
ret = distro_efi_get_fdt_name(fname, sizeof(fname), seq);
if (ret == -EALREADY)
bflow->flags = BOOTFLOWF_USE_PRIOR_FDT;
- if (!ret)
+ if (!ret) {
+ /* Limit FDT files to 4MB */
+ size = SZ_4M;
ret = bootmeth_common_read_file(dev, bflow, fname,
fdt_addr, &size);
+ }
}
if (*fname) {