[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] [patch] len is uninitialized



Hi John,

local variable `len' in mach_early_init for suzaku is used
uninitialized when CONFIG_MTD_UCLINUX is not set.

this patch fix it.

thanks,
--
           yashi

 suzaku.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Index: linux-suzaku/arch/microblaze/kernel/suzaku.c
===================================================================
--- linux-suzaku.orig/arch/microblaze/kernel/suzaku.c	2004-09-27 16:13:15.081293958 +0900
+++ linux-suzaku/arch/microblaze/kernel/suzaku.c	2004-09-27 16:13:52.899590382 +0900
@@ -103,17 +103,18 @@ void __init mach_early_init (void)
 		*(dst++) = *(src++);
 	} while (src < &_intv_load_end);
 
+        _ramstart = (unsigned long)__bss_stop;
+
 #ifdef CONFIG_MTD_UCLINUX
         /* if CONFIG_MTD_UCLINUX is defined, assume ROMFS is at the
          * end of kernel, which is ROMFS_LOCATION defined above. */
 	len = get_romfs_len(ROMFS_LOCATION);
+        _ramstart += len;
 
 	/* Use memmove to handle likely case of memory overlap */
 	MOVE_ROMFS(__bss_stop,__bss_start,len);
 #endif
 
-        _ramstart = (unsigned long)__bss_stop + len;
-	
 	/* Zero the BSS and SBSS sections */
 	memset(__bss_start,0,__bss_stop-__bss_start);
 	memset(&_ssbss,0,&_esbss-&_ssbss);
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/