Fix panics when using iflib pseudo device support
Reviewed by: gallatin@, hselasky@ MFC after: 1 week Sponsored by: Netgate, Inc. Differential Revision: https://reviews.freebsd.org/D23710
This commit is contained in:
parent
0cfac4d5c6
commit
1f93e931d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361665
@ -4902,6 +4902,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sctx, if_ctx_t *ctxp,
|
|||||||
if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
|
if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
|
||||||
iflib_add_device_sysctl_post(ctx);
|
iflib_add_device_sysctl_post(ctx);
|
||||||
ctx->ifc_flags |= IFC_INIT_DONE;
|
ctx->ifc_flags |= IFC_INIT_DONE;
|
||||||
|
CTX_UNLOCK(ctx);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
_iflib_pre_assert(scctx);
|
_iflib_pre_assert(scctx);
|
||||||
@ -5354,7 +5355,8 @@ iflib_register(if_ctx_t ctx)
|
|||||||
device_t dev = ctx->ifc_dev;
|
device_t dev = ctx->ifc_dev;
|
||||||
if_t ifp;
|
if_t ifp;
|
||||||
|
|
||||||
_iflib_assert(sctx);
|
if ((sctx->isc_flags & IFLIB_PSEUDO) == 0)
|
||||||
|
_iflib_assert(sctx);
|
||||||
|
|
||||||
CTX_LOCK_INIT(ctx);
|
CTX_LOCK_INIT(ctx);
|
||||||
STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev));
|
STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev));
|
||||||
|
Loading…
Reference in New Issue
Block a user