diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-01-13 13:02:29 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-01-13 14:31:03 +0100 |
commit | a7acf2e7464c457b0a54f2acc2f850a885ead9cf (patch) | |
tree | b816dab5cd8fc1de35c6d355d10e5f788486de32 /commands | |
parent | 1a3c1d3de1b5d92ed430b01855fe30d01f092e83 (diff) | |
download | barebox-a7acf2e7464c457b0a54f2acc2f850a885ead9cf.tar.gz barebox-a7acf2e7464c457b0a54f2acc2f850a885ead9cf.tar.xz |
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')
-rw-r--r-- | commands/memtest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/memtest.c b/commands/memtest.c index 16cc7ccb94..f44459abc1 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; |