aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-11-01 16:36:21 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-11-01 16:36:21 +0000
commite399f19dba4fd8981e66f9186cda2e7f3ba4d1dc (patch)
treed791c42c4231e33e0f812788ed53f13c84609a57 /sys/net
parent899322fdfa2a0bb2c6bd26c320312fc5886af084 (diff)
Notes
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_media.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/net/if_media.c b/sys/net/if_media.c
index 3bcf44043ca9c..354a013e98489 100644
--- a/sys/net/if_media.c
+++ b/sys/net/if_media.c
@@ -102,8 +102,7 @@ ifmedia_removeall(struct ifmedia *ifm)
{
struct ifmedia_entry *entry;
- for (entry = LIST_FIRST(&ifm->ifm_list); entry;
- entry = LIST_FIRST(&ifm->ifm_list)) {
+ while ((entry = LIST_FIRST(&ifm->ifm_list)) != NULL) {
LIST_REMOVE(entry, ifm_list);
free(entry, M_IFADDR);
}