Fix non working continue in do while(0) loop.
authorbluhm <bluhm@openbsd.org>
Fri, 12 Aug 2022 16:42:54 +0000 (16:42 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 12 Aug 2022 16:42:54 +0000 (16:42 +0000)
OK mvs@ jca@
CID 1519492

sys/net/if_media.c

index 34beefc..31a888d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: if_media.c,v 1.37 2022/08/05 13:57:16 bluhm Exp $     */
+/*     $OpenBSD: if_media.c,v 1.38 2022/08/12 16:42:54 bluhm Exp $     */
 /*     $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $      */
 
 /*-
@@ -338,7 +338,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm,
                        return (0);
                }
 
-               do {
+               while (1) {
                        struct ifmedia_entry *ife;
                        uint64_t *kptr;
                        size_t ksiz;
@@ -376,7 +376,8 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm,
                        error = copyout(kptr, ifmr->ifm_ulist,
                            nwords * sizeof(*kptr));
                        free(kptr, M_TEMP, ksiz);
-               } while (0);
+                       break;
+               }
                ifmr->ifm_count = nwords;
                break;
        }