Skip to content

Commit

Permalink
wavelan: Test arraysize before an element of the array.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and John W. Linville committed Feb 27, 2009
1 parent 076ae60 commit 4d8faf6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/wavelan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4d8faf6

Please sign in to comment.