From c169d9fe07ad2ad1767ccc9725a0dc9eef052175 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sat, 28 May 2016 08:32:15 +0000 Subject: [PATCH] In if_attachdomain1() there does not seem to be any reason to use TRYLOCK rather than just acquire the lock, so just do that. Reviewed by: markj Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6578 --- sys/net/if.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index c9890073a8c..6845bbf7ee0 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -821,8 +821,7 @@ if_attachdomain1(struct ifnet *ifp) * Since dp->dom_ifattach calls malloc() with M_WAITOK, we * cannot lock ifp->if_afdata initialization, entirely. */ - if (IF_AFDATA_TRYLOCK(ifp) == 0) - return; + IF_AFDATA_LOCK(ifp); if (ifp->if_afdata_initialized >= domain_init_status) { IF_AFDATA_UNLOCK(ifp); log(LOG_WARNING, "%s called more than once on %s\n", -- 2.45.2