diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2014-02-20 14:37:40 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-06 20:52:28 +0100 |
commit | d334c2b9de03c62767d04d8d927bc6d06f3fbd62 (patch) | |
tree | 0eb3eecf6b4f5d1fc59df0fde3cad958654579e0 | |
parent | f5179287b016cc61d6ad77b4a15fab9b6932df83 (diff) | |
download | linux-d334c2b9de03c62767d04d8d927bc6d06f3fbd62.tar.bz2 |
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: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/6574/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/alchemy/board-gpr.c | 4 | ||||
-rw-r--r-- | arch/mips/alchemy/board-mtx1.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c index 9edc35ff8cf1..acf9a2a37f5a 100644 --- a/arch/mips/alchemy/board-gpr.c +++ b/arch/mips/alchemy/board-gpr.c @@ -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); } diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c index 9969dbab19e3..25a59a23547e 100644 --- a/arch/mips/alchemy/board-mtx1.c +++ b/arch/mips/alchemy/board-mtx1.c @@ -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); } |