Commit 4d8faf69 authored by Roel Kluin's avatar Roel Kluin Committed by John W. Linville

wavelan: Test arraysize before an element of the array.

Test arraysize before an element of the array.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 076ae609
...@@ -4281,8 +4281,7 @@ int __init init_module(void) ...@@ -4281,8 +4281,7 @@ int __init init_module(void)
/* Loop on all possible base addresses. */ /* Loop on all possible base addresses. */
i = -1; for (i = 0; i < ARRAY_SIZE(io) && io[i] != 0; i++) {
while ((io[++i] != 0) && (i < ARRAY_SIZE(io))) {
struct net_device *dev = alloc_etherdev(sizeof(net_local)); struct net_device *dev = alloc_etherdev(sizeof(net_local));
if (!dev) if (!dev)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment