Commit d334c2b9 authored by Manuel Lauss's avatar Manuel Lauss Committed by Ralf Baechle
Browse files

MIPS: Alchemy: Fix unchecked kstrtoul return value



enabled __must_check logic triggers a build error for mtx1 and gpr
in the prom init code.  Fix by checking the kstrtoul() return value.

Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/6574/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f5179287
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -53,10 +53,8 @@ void __init prom_init(void)
	prom_init_cmdline();

	memsize_str = prom_getenv("memsize");
	if (!memsize_str)
	if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
		memsize = 0x04000000;
	else
		strict_strtoul(memsize_str, 0, &memsize);
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}

+1 −3
Original line number Diff line number Diff line
@@ -52,10 +52,8 @@ void __init prom_init(void)
	prom_init_cmdline();

	memsize_str = prom_getenv("memsize");
	if (!memsize_str)
	if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
		memsize = 0x04000000;
	else
		strict_strtoul(memsize_str, 0, &memsize);
	add_memory_region(0, memsize, BOOT_MEM_RAM);
}