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: 867e359b97 ("arch/tile: core support for Tilera 32-bit chips.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
This commit is contained in:
Dan Carpenter 2017-07-22 10:33:02 +03:00 committed by Chris Metcalf
parent 7c88f2bf78
commit 637f23abca
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ static int __init setup_maxnodemem(char *str)
{ {
char *endp; char *endp;
unsigned long long maxnodemem; unsigned long long maxnodemem;
long node; unsigned long node;
node = str ? simple_strtoul(str, &endp, 0) : INT_MAX; node = str ? simple_strtoul(str, &endp, 0) : INT_MAX;
if (node >= MAX_NUMNODES || *endp != ':') if (node >= MAX_NUMNODES || *endp != ':')