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

Reviewed by:	hselasky
Sponsored by:	Mellanox Technologies/NVidia Networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27034
This commit is contained in:
Konstantin Belousov 2020-11-01 16:36:21 +00:00
parent 899322fdfa
commit e399f19dba

View file

@ -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);
}