summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDmitry Lavnikevich <d.lavnikevich@sam-solutions.com>2015-01-23 14:41:41 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2015-01-27 09:03:07 +0100
commit0d8ef327bbb5e3d6e19f9753e663163145e9d1b1 (patch)
tree9528680bca3f9df9bd97ee467b2d0abe9265e370 /commands
parent866516511e274b9776f59c5b59ce46c20dfc10af (diff)
downloadbarebox-0d8ef327bbb5e3d6e19f9753e663163145e9d1b1.tar.gz
memtest: fix 4GB overflow fail
Add condition for checking size_t overflow. This fixes memtest fail > Memtest failed. Error: -22 which appears when 4GB RAM is present. Was tested on phyFLEX-i.MX6 modules with 4GB and 1GB RAM. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/memtest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/memtest.c b/commands/memtest.c
index 379d82e..9dec0ef 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -108,7 +108,7 @@ static int request_memtest_regions(struct list_head *list)
start = PAGE_ALIGN(r->end);
end = bank->res->end;
size = PAGE_ALIGN_DOWN(end - start + 1);
- if (start < end) {
+ if (start < end && start > r->end) {
ret = alloc_memtest_region(list, start, size);
if (ret < 0)
return ret;