--- zzzz-none-000/linux-3.10.107/arch/mips/fw/lib/cmdline.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/mips/fw/lib/cmdline.c 2021-02-04 17:41:59.000000000 +0000 @@ -35,6 +35,7 @@ else _fw_envp = (int *)fw_arg2; + arcs_cmdline[0] = '\0'; for (i = 1; i < fw_argc; i++) { strlcat(arcs_cmdline, fw_argv(i), COMMAND_LINE_SIZE); if (i < (fw_argc - 1)) @@ -68,7 +69,7 @@ result = fw_envp(index + 1); break; } else if (fw_envp(index)[i] == '=') { - result = (fw_envp(index + 1) + i); + result = fw_envp(index) + i + 1; break; } } @@ -88,13 +89,13 @@ { unsigned long envl = 0UL; char *str; - long val; int tmp; str = fw_getenv(envname); if (str) { - tmp = kstrtol(str, 0, &val); - envl = (unsigned long)val; + tmp = kstrtoul(str, 0, &envl); + if (tmp) + envl = 0; } return envl;