Root/target/linux/lantiq/patches/0002-MIPS-lantiq-fix-cmdline-parsing.patch

1From b85d5204f2fe8c3b5e6172f7cc1741ad6e849334 Mon Sep 17 00:00:00 2001
2From: John Crispin <blogic@openwrt.org>
3Date: Fri, 12 Aug 2011 16:27:38 +0200
4Subject: [PATCH 02/24] MIPS: lantiq: fix cmdline parsing
5
6The code tested if the KSEG1 mapped address of argv was != 0. We need to use
7CPHYSADDR instead to make the conditional actually work.
8
9Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
10Signed-off-by: John Crispin <blogic@openwrt.org>
11Cc: linux-mips@linux-mips.org
12---
13 arch/mips/lantiq/prom.c | 6 ++++--
14 1 files changed, 4 insertions(+), 2 deletions(-)
15
16--- a/arch/mips/lantiq/prom.c
17+++ b/arch/mips/lantiq/prom.c
18@@ -45,10 +45,12 @@ static void __init prom_init_cmdline(voi
19     char **argv = (char **) KSEG1ADDR(fw_arg1);
20     int i;
21 
22+ arcs_cmdline[0] = '\0';
23+
24     for (i = 0; i < argc; i++) {
25- char *p = (char *) KSEG1ADDR(argv[i]);
26+ char *p = (char *) KSEG1ADDR(argv[i]);
27 
28- if (p && *p) {
29+ if (CPHYSADDR(p) && *p) {
30             strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
31             strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
32         }
33

Archive Download this file



interactive