From: Dan Carpenter Date: Sat, 22 Jul 2017 07:33:02 +0000 (+0300) Subject: tile: array underflow in setup_maxnodemem() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=637f23abca87d26e091e0d6647ec878d97d2c6cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tile: array underflow in setup_maxnodemem() My static checker correctly complains that we should have a lower bound on "node" to prevent an array underflow. Fixes: 867e359b97c9 ("arch/tile: core support for Tilera 32-bit chips.") Signed-off-by: Dan Carpenter Signed-off-by: Chris Metcalf --- diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 443a70bccc1c..b1474e7d9afb 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c @@ -140,7 +140,7 @@ static int __init setup_maxnodemem(char *str) { char *endp; unsigned long long maxnodemem; - long node; + unsigned long node; node = str ? simple_strtoul(str, &endp, 0) : INT_MAX; if (node >= MAX_NUMNODES || *endp != ':')