Skip to contentSkip to conversation

MIPS: Alchemy: fix unchecked kstrtoul return value

PATCH New Manuel Lauss 1 participant 1 message Feb 20, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/mips/alchemy/board-gpr.c  | 4 +---
 arch/mips/alchemy/board-mtx1.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/mips/alchemy/board-gpr.c +1 -3
index 9edc35f..acf9a2a 100644
@@ -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);
 }
 
arch/mips/alchemy/board-mtx1.c +1 -3
index 9969dba..25a59a2 100644
@@ -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);
 }
 
Signature · 1 line
1.8.5.5