bootm: fix wrong conditions about images overlap
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 21 Oct 2020 03:11:36 +0000 (12:11 +0900)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 10:37:12 +0000 (11:37 +0100)
commitae7b1135efc6a9c8f6ba6008b4964ad5423290d9
tree6383b8510b057aad7d27ea548365026adce7942b
parentaa7b14608a041523b6426bcb113002241759737c
bootm: fix wrong conditions about images overlap

It doesn't need to consider start byte address.
If ramdisk size is 0x800000 and start address is 0x2700000, then it's
used until 0x02efffff, not 0x02f00000. But it's detected to overlapt RD
image, when kernel start address is 0x02f00000.
Because it's doing wrong calculation about rd_len.
This patch fixed wrong calculation address position when check
condition.

In addition, it needs to check one more condition about overlapping
entire area.

Fixes: commit fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
common/bootm.c