summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-02-11 21:51:31 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 20:51:41 +0100
commit4d8faf6937fd7ada1f523b1cf565ffd2a0623e8c (patch)
tree2f96ecba829463d9c3c1bec48562bb61203391be
parentmac80211: disallow moving netns (diff)
downloadlinux-4d8faf6937fd7ada1f523b1cf565ffd2a0623e8c.tar.xz
linux-4d8faf6937fd7ada1f523b1cf565ffd2a0623e8c.zip
wavelan: Test arraysize before an element of the array.
Test arraysize before an element of the array. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/wavelan.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index 688bdea8f13a..b728541f2fb5 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -4281,8 +4281,7 @@ int __init init_module(void)
/* Loop on all possible base addresses. */
- i = -1;
- while ((io[++i] != 0) && (i < ARRAY_SIZE(io))) {
+ for (i = 0; i < ARRAY_SIZE(io) && io[i] != 0; i++) {
struct net_device *dev = alloc_etherdev(sizeof(net_local));
if (!dev)
break;