tile: array underflow in setup_maxnodemem()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 22 Jul 2017 07:33:02 +0000 (10:33 +0300)
committerChris Metcalf <cmetcalf@mellanox.com>
Mon, 24 Jul 2017 15:24:03 +0000 (11:24 -0400)
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 <dan.carpenter@oracle.com>
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
arch/tile/kernel/setup.c

index 443a70bccc1c862d945d3a84945c6771033b74c7..b1474e7d9afb3f564631cfffa22652014c9c5beb 100644 (file)
@@ -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 != ':')