Author: mmacy
Date: Sun May 31 18:42:00 2020
New Revision: 361665
URL: https://svnweb.freebsd.org/changeset/base/361665

Log:
  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

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c        Sun May 31 18:20:20 2020        (r361664)
+++ head/sys/net/iflib.c        Sun May 31 18:42:00 2020        (r361665)
@@ -4902,6 +4902,7 @@ iflib_pseudo_register(device_t dev, if_shared_ctx_t sc
                if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter);
                iflib_add_device_sysctl_post(ctx);
                ctx->ifc_flags |= IFC_INIT_DONE;
+               CTX_UNLOCK(ctx);
                return (0);
        }
        _iflib_pre_assert(scctx);
@@ -5354,7 +5355,8 @@ iflib_register(if_ctx_t ctx)
        device_t dev = ctx->ifc_dev;
        if_t ifp;
 
-       _iflib_assert(sctx);
+       if ((sctx->isc_flags & IFLIB_PSEUDO) == 0)
+               _iflib_assert(sctx);
 
        CTX_LOCK_INIT(ctx);
        STATE_LOCK_INIT(ctx, device_get_nameunit(ctx->ifc_dev));
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to