Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Nov 2020 01:01:28 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r367472 - stable/12/sys/net
Message-ID:  <202011080101.0A811SSD094464@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011080101.0A811SSD094464>