提交 e3a5cd9e 编写于 作者: A Adrian Bunk 提交者: 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: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d938ab44
...@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct class_device *dev, char *buf) ...@@ -165,7 +165,7 @@ static ssize_t show_operstate(struct class_device *dev, char *buf)
operstate = IF_OPER_DOWN; operstate = IF_OPER_DOWN;
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
if (operstate >= sizeof(operstates)) if (operstate >= ARRAY_SIZE(operstates))
return -EINVAL; /* should not happen */ return -EINVAL; /* should not happen */
return sprintf(buf, "%s\n", operstates[operstate]); return sprintf(buf, "%s\n", operstates[operstate]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册