]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: 6144/1: TCM memory bug freeing bug
authorLinus Walleij <linus.walleij@stericsson.com>
Wed, 26 May 2010 06:37:57 +0000 (07:37 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:22:34 +0000 (11:22 -0700)
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 <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/mm/init.c

index 0ed29bfeba1cc0d6896fe3877e8653c26d1867f8..55d07c8b427084b4eb82702dd219c6191196acfb 100644 (file)
@@ -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