mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
[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