[NET]: Fix an off-by-21-or-49 error.
authorAdrian Bunk <bunk@stusta.de>
Thu, 6 Apr 2006 05:19:47 +0000 (22:19 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 10 Apr 2006 05:25:26 +0000 (22:25 -0700)
This patch fixes an off-by-21-or-49 error ;-) spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c

index 21b68464cabbd38530f14fee95dd875a71ad877e..c12990c9c603ebb0403ffaab710139409cde81de 100644 (file)
@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct class_device *dev, char *buf)
                operstate = IF_OPER_DOWN;
        read_unlock(&dev_base_lock);
 
-       if (operstate >= sizeof(operstates))
+       if (operstate >= ARRAY_SIZE(operstates))
                return -EINVAL; /* should not happen */
 
        return sprintf(buf, "%s\n", operstates[operstate]);