Commit e3a5cd9e authored by Adrian Bunk's avatar Adrian Bunk Committed by David S. Miller

[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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d938ab44
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment