mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
iflib: Unlock ctx lock around call to ether_ifattach()
Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 271768 Reviewed by: erj@, jhb@ MFC after: 1 day Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557
This commit is contained in:
parent
e5c4737955
commit
a52f23f4c4
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue