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>
This commit is contained in:
parent
866516511e
commit
0d8ef327bb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue