Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 730fa039 authored by Thomas Langer's avatar Thomas Langer Committed by Ralf Baechle
Browse files

MIPS: lantiq: fix cmdline parsing



The code tested if the KSEG1 mapped address of argv was != 0. We need to use
CPHYSADDR instead to make the conditional actually work.

Signed-off-by: default avatarThomas Langer <thomas.langer@lantiq.com>
Signed-off-by: default avatarJohn Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3722/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 7705f686
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -45,10 +45,12 @@ static void __init prom_init_cmdline(void)
	char **argv = (char **) KSEG1ADDR(fw_arg1);
	int i;

	arcs_cmdline[0] = '\0';

	for (i = 0; i < argc; i++) {
		char *p = (char *) KSEG1ADDR(argv[i]);

		if (p && *p) {
		if (CPHYSADDR(p) && *p) {
			strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
			strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
		}