From a7acf2e7464c457b0a54f2acc2f850a885ead9cf Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 13 Jan 2009 13:02:29 +0100 Subject: 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 --- commands/memtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands/memtest.c') 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; -- cgit v1.2.3