From 82cd4163b485606155811198eb2a033d1932002a Mon Sep 17 00:00:00 2001 From: thompsa Date: Fri, 23 Feb 2007 19:37:55 +0000 Subject: Move the lock init until after if_alloc in case the allocation fails and we free the softc and return. MFC after: 3 days --- sys/net/if_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/net/if_bridge.c') diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 359d7dd..5615a5b 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -532,13 +532,13 @@ bridge_clone_create(struct if_clone *ifc, int unit, caddr_t params) int retry; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); - BRIDGE_LOCK_INIT(sc); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { free(sc, M_DEVBUF); return (ENOSPC); } + BRIDGE_LOCK_INIT(sc); sc->sc_brtmax = BRIDGE_RTABLE_MAX; sc->sc_brttimeout = BRIDGE_RTABLE_TIMEOUT; -- cgit v1.1