Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2019 17:34:25 +0000 (UTC)
From:      Eric Joyner <erj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352910 - stable/12/sys/net
Message-ID:  <201909301734.x8UHYPfb076585@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909301734.x8UHYPfb076585>