[NET]: Fix an off-by-21-or-49 error.

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>
This commit is contained in:
Adrian Bunk 2006-04-05 22:19:47 -07:00 committed by David S. Miller
parent d938ab44c0
commit e3a5cd9edf

View 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]);