rewrite of memory detection code, should be fix #1909
[openwrt/openwrt.git] / target / linux / adm5120-2.6 / files / arch / mips / adm5120 / prom.c
index a288b073cab9f4023a76715ba92b580ef3e15a4f..c2e1dcbae1e43d8804db939f187a7ca46f598b1f 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <asm/mach-adm5120/adm5120_info.h>
 
-static char **prom_envp;
+static char **prom_envp = NULL;
 
 void setup_prom_printf(int);
 void prom_printf(char *, ...);
@@ -106,7 +106,9 @@ void __init prom_init(void)
 {
        char *cmd;
 
-       prom_envp = (char **)fw_arg2;
+       if ((fw_arg2 & 3) == 0) {
+               prom_envp = (char **)fw_arg2;
+       }
 
        adm5120_info_init();