Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2013 04:45:59 +0000 (UTC)
From:      "Justin T. Gibbs" <gibbs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251176 - head/sys/dev/xen/netfront
Message-ID:  <201305310445.r4V4jx7N018878@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gibbs
Date: Fri May 31 04:45:59 2013
New Revision: 251176
URL: http://svnweb.freebsd.org/changeset/base/251176

Log:
  Make netif_free() safe to call on a partially initialized softc.
  
  Sponsored by:	Spectra Logic Corporation
  MFC after:	1 week

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c	Fri May 31 04:43:19 2013	(r251175)
+++ head/sys/dev/xen/netfront/netfront.c	Fri May 31 04:45:59 2013	(r251176)
@@ -2177,8 +2177,11 @@ netif_free(struct netfront_info *info)
 	callout_drain(&info->xn_stat_ch);
 	netif_disconnect_backend(info);
 	ifmedia_removeall(&info->sc_media);
-	ether_ifdetach(info->xn_ifp);
-	if_free(info->xn_ifp);
+	if (info->xn_ifp != NULL) {
+		ether_ifdetach(info->xn_ifp);
+		if_free(info->xn_ifp);
+		info->xn_ifp = NULL;
+	}
 }
 
 static void



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