projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d938ab4
)
[NET]: Fix an off-by-21-or-49 error.
author
Adrian Bunk
<bunk@stusta.de>
Thu, 6 Apr 2006 05:19:47 +0000
(22:19 -0700)
committer
David S. Miller
<davem@sunset.davemloft.net>
Mon, 10 Apr 2006 05:25:26 +0000
(22:25 -0700)
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>
net/core/net-sysfs.c
patch
|
blob
|
history
diff --git
a/net/core/net-sysfs.c
b/net/core/net-sysfs.c
index 21b68464cabbd38530f14fee95dd875a71ad877e..c12990c9c603ebb0403ffaab710139409cde81de 100644
(file)
--- a/
net/core/net-sysfs.c
+++ b/
net/core/net-sysfs.c
@@
-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]);