bootm: Fix upper bound of FDT overlap checks

FTD blob can be put immediately after the OS image.
So use strict inequality for start address check.

Fixes: fbde7589ce ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Pali Rohár 2022-08-27 14:48:10 +02:00 committed by Tom Rini
parent 88de6c5127
commit 5acfdfbd43

View File

@ -305,9 +305,9 @@ int bootm_find_images(int flag, int argc, char *const argv[], ulong start,
/* check if FDT overlaps OS image */
if (images.ft_addr &&
(((ulong)images.ft_addr >= start &&
(ulong)images.ft_addr <= start + size) ||
(ulong)images.ft_addr < start + size) ||
((ulong)images.ft_addr + images.ft_len >= start &&
(ulong)images.ft_addr + images.ft_len <= start + size))) {
(ulong)images.ft_addr + images.ft_len < start + size))) {
printf("ERROR: FDT image overlaps OS image (OS=0x%lx..0x%lx)\n",
start, start + size);
return 1;