svn commit: r367472 - stable/12/sys/net

Konstantin Belousov kib at FreeBSD.org
Sun Nov 8 01:01:28 UTC 2020


Author: kib
Date: Sun Nov  8 01:01:27 2020
New Revision: 367472
URL: https://svnweb.freebsd.org/changeset/base/367472

Log:
  MFC r367251:
  Cleanup of net/if_media.c: simplify cleanup loop in ifmedia_removeall().

Modified:
  stable/12/sys/net/if_media.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/net/if_media.c
==============================================================================
--- stable/12/sys/net/if_media.c	Sun Nov  8 01:00:10 2020	(r367471)
+++ stable/12/sys/net/if_media.c	Sun Nov  8 01:01:27 2020	(r367472)
@@ -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);
 	}


More information about the svn-src-all mailing list