svn commit: r352910 - stable/12/sys/net
Eric Joyner
erj at FreeBSD.org
Mon Sep 30 17:34:25 UTC 2019
Author: erj
Date: Mon Sep 30 17:34:25 2019
New Revision: 352910
URL: https://svnweb.freebsd.org/changeset/base/352910
Log:
MFC r352655: iflib: Remove redundant VLAN events deregistration
This fixes a kernel panic that can occur when unloading an iflib-using driver.
Sponsored by: Intel Corporation
Modified:
stable/12/sys/net/iflib.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/net/iflib.c
==============================================================================
--- stable/12/sys/net/iflib.c Mon Sep 30 17:27:59 2019 (r352909)
+++ stable/12/sys/net/iflib.c Mon Sep 30 17:34:25 2019 (r352910)
@@ -4260,6 +4260,9 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag
if ((vtag == 0) || (vtag > 4095))
return;
+ if (iflib_in_detach(ctx))
+ return;
+
CTX_LOCK(ctx);
IFDI_VLAN_REGISTER(ctx, vtag);
/* Re-init to load the changes */
@@ -5024,12 +5027,6 @@ iflib_device_deregister(if_ctx_t ctx)
CTX_LOCK(ctx);
iflib_stop(ctx);
CTX_UNLOCK(ctx);
-
- /* Unregister VLAN events */
- if (ctx->ifc_vlan_attach_event != NULL)
- EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event);
- if (ctx->ifc_vlan_detach_event != NULL)
- EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event);
iflib_netmap_detach(ifp);
ether_ifdetach(ifp);
More information about the svn-src-stable-12
mailing list