summaryrefslogtreecommitdiffstats
path: root/sys/net/if_bridge.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-02-23 19:37:55 +0000
committerthompsa <thompsa@FreeBSD.org>2007-02-23 19:37:55 +0000
commit82cd4163b485606155811198eb2a033d1932002a (patch)
treead5c02a0ca6d6525b2c4ec3c200d697a6dc0004e /sys/net/if_bridge.c
parent33ad2957017b8f8863b4b5cc1ee316848480a741 (diff)
downloadFreeBSD-src-82cd4163b485606155811198eb2a033d1932002a.zip
FreeBSD-src-82cd4163b485606155811198eb2a033d1932002a.tar.gz
Move the lock init until after if_alloc in case the allocation fails and we
free the softc and return. MFC after: 3 days
Diffstat (limited to 'sys/net/if_bridge.c')
-rw-r--r--sys/net/if_bridge.c2
1 files changed, 1 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud