forked from Minki/linux
[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:
parent
d938ab44c0
commit
e3a5cd9edf
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user