From: Linus Walleij Date: Wed, 26 May 2010 06:37:57 +0000 (+0100) Subject: ARM: 6144/1: TCM memory bug freeing bug X-Git-Tag: v2.6.34.1~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df5fe92090f87b7bbaa3c849f1f085f157acdecf;p=thirdparty%2Fkernel%2Fstable.git ARM: 6144/1: TCM memory bug freeing bug commit ea208f646c8fb91c39c852e952fc911e1ad045ab upstream. This fixes a bug in mm/init.c when freeing the TCM compile memory, this was being referred to as a char * which is incorrect: this will dereference the pointer and feed in the value at the location instead of the address to it. Change it to a plain char and use &(char) to reference it. Signed-off-by: Linus Walleij Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0ed29bfeba1cc..55d07c8b42708 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -712,10 +712,10 @@ void __init mem_init(void) void free_initmem(void) { #ifdef CONFIG_HAVE_TCM - extern char *__tcm_start, *__tcm_end; + extern char __tcm_start, __tcm_end; - totalram_pages += free_area(__phys_to_pfn(__pa(__tcm_start)), - __phys_to_pfn(__pa(__tcm_end)), + totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)), + __phys_to_pfn(__pa(&__tcm_end)), "TCM link"); #endif