Explorar o código

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>
Roel Kluin %!s(int64=16) %!d(string=hai) anos
pai
achega
4d8faf6937
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      drivers/net/wireless/wavelan.c

+ 1 - 2
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;