summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-12-28 22:25:40 +0000
committermmcc <mmcc@openbsd.org>2015-12-28 22:25:40 +0000
commita181b6cc1caad273ba526aede87b34224ce29e8d (patch)
tree475b0063c32f83382c7c28f6e8599d359a1b85c8
parentremove spaces after '!' (diff)
downloadwireguard-openbsd-a181b6cc1caad273ba526aede87b34224ce29e8d.tar.xz
wireguard-openbsd-a181b6cc1caad273ba526aede87b34224ce29e8d.zip
1. Add a loop_end label to the outer loop
2. Replace a continue statement in an inner loop with goto loop_end This fixes a simple logical bug found with Coccinelle. ok kettenis@
-rw-r--r--sys/dev/mii/mii.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c
index e6aa5442070..1f0609b8ebe 100644
--- a/sys/dev/mii/mii.c
+++ b/sys/dev/mii/mii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mii.c,v 1.21 2010/04/20 20:42:16 deraadt Exp $ */
+/* $OpenBSD: mii.c,v 1.22 2015/12/28 22:25:40 mmcc Exp $ */
/* $NetBSD: mii.c,v 1.19 2000/02/02 17:09:44 thorpej Exp $ */
/*-
@@ -95,7 +95,7 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask,
* configured at this address.
*/
offset++;
- continue;
+ goto loop_end;
}
}
@@ -144,6 +144,8 @@ mii_attach(struct device *parent, struct mii_data *mii, int capmask,
mii->mii_instance++;
}
offset++;
+
+ loop_end: ;
}
}