wavelan: Test arraysize before an element of the array.
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 11 Feb 2009 20:51:31 +0000 (21:51 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 27 Feb 2009 19:51:41 +0000 (14:51 -0500)
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>
drivers/net/wireless/wavelan.c

index 688bdea8f13a8cc1b74c025e7bdd4acb40528699..b728541f2fb538c116367fb0241e1247b0859d64 100644 (file)
@@ -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;