aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/iflib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/iflib.c b/sys/net/iflib.c
index d056570d9a99..9f433481afda 100644
--- a/sys/net/iflib.c
+++ b/sys/net/iflib.c
@@ -5386,7 +5386,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
goto fail_queues;
}
+ /*
+ * It prevents a double-locking panic with iflib_media_status when
+ * the driver loads.
+ */
+ CTX_UNLOCK(ctx);
ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet);
+ CTX_LOCK(ctx);
if ((err = IFDI_ATTACH_POST(ctx)) != 0) {
device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err);