From 0d8ef327bbb5e3d6e19f9753e663163145e9d1b1 Mon Sep 17 00:00:00 2001 From: Dmitry Lavnikevich Date: Fri, 23 Jan 2015 14:41:41 +0300 Subject: 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 Signed-off-by: Sascha Hauer --- commands/memtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/memtest.c b/commands/memtest.c index 379d82eab4..9dec0efcba 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; -- cgit v1.2.3