From: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
To: barebox@lists.infradead.org
Cc: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Subject: [PATCH 1/2] memtest: fix 4GB overflow fail
Date: Fri, 23 Jan 2015 14:41:41 +0300 [thread overview]
Message-ID: <1422013301-16827-1-git-send-email-d.lavnikevich@sam-solutions.com> (raw)
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>
---
commands/memtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/memtest.c b/commands/memtest.c
index d384436afb73..5e7896cc711c 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -109,7 +109,7 @@ static int request_memtest_regions(struct list_head *list)
start = PAGE_ALIGN(r->end);
end = PAGE_ALIGN_DOWN(bank->res->end) - 1;
size = end - start + 1;
- if (start < end) {
+ if (start < end && start > r->end) {
ret = alloc_memtest_region(list, start, size);
if (ret < 0)
return ret;
--
2.2.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2015-01-23 11:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 11:41 Dmitry Lavnikevich [this message]
2015-01-23 11:48 ` [PATCH 2/2] dts:imx6:pfla02: Align nand partitions by 512k Dmitry Lavnikevich
2015-01-27 8:09 ` Sascha Hauer
2015-01-27 9:35 ` Christian Hemp
2015-01-27 9:39 ` Dmitry Lavnikevich
2015-01-26 9:09 ` [PATCH 1/2] memtest: fix 4GB overflow fail Sascha Hauer
2015-01-26 11:09 ` Dmitry Lavnikevich
2015-01-27 8:10 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422013301-16827-1-git-send-email-d.lavnikevich@sam-solutions.com \
--to=d.lavnikevich@sam-solutions.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox