* [PATCH] wavelan: Test arraysize before an element of the array.
@ 2009-02-11 20:51 Roel Kluin
2009-02-11 21:15 ` Jean Tourrilhes
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-02-11 20:51 UTC (permalink / raw)
To: jt; +Cc: linux-wireless, Andrew Morton
Test arraysize before an element of the array.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index 8326793..5439e39 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;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-02-11 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-11 20:51 [PATCH] wavelan: Test arraysize before an element of the array Roel Kluin
2009-02-11 21:15 ` Jean Tourrilhes
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.