summaryrefslogtreecommitdiffstats
path: root/commands/memtest.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-01-13 13:02:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2009-01-13 14:31:03 +0100
commita7acf2e7464c457b0a54f2acc2f850a885ead9cf (patch)
treeb816dab5cd8fc1de35c6d355d10e5f788486de32 /commands/memtest.c
parent1a3c1d3de1b5d92ed430b01855fe30d01f092e83 (diff)
downloadbarebox-a7acf2e7464c457b0a54f2acc2f850a885ead9cf.tar.gz
mtest: remove braindamaged NULL pointer deref
The alternative memory test implementation needs a scratch memory location to remove the last data from the data bus. Instead of using a NULL pointer for this, default to the memory start address. No sane program should consider a NULL pointer as a safe default. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/memtest.c')
-rw-r--r--commands/memtest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/memtest.c b/commands/memtest.c
index 16cc7cc..f44459a 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -51,7 +51,7 @@ static int mem_test(ulong _start, ulong _end, ulong pattern_unused)
#ifdef CFG_MEMTEST_SCRATCH
vu_long *dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
#else
- vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */
+ vu_long *dummy = start;
#endif
int j;
int iterations = 1;