]> git.baikalelectronics.ru Git - uboot.git/commit
lmb: fix allocation at end of address range
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Mon, 14 Jan 2019 21:38:15 +0000 (22:38 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 16 Jan 2019 21:36:48 +0000 (16:36 -0500)
commit851ad39336c60e987c4502cfc59fb48f38ae5346
tree26bf0439372588bf6a600387650033862ae90f34
parent16d85a314355c1375089cf1afa156c1b644fd2d0
lmb: fix allocation at end of address range

The lmb code fails if base + size of RAM overflows to zero.

Fix this by calculating end as 'base + size - 1' instead of 'base + size'
where appropriate.

Added tests to assert this is fixed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
lib/lmb.c
test/lib/lmb.c