svn commit: r251176 - head/sys/dev/xen/netfront

Justin T. Gibbs gibbs at FreeBSD.org
Fri May 31 04:46:00 UTC 2013


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


More information about the svn-src-head mailing list