Make netif_free() safe to call on a partially initialized softc.

Sponsored by:	Spectra Logic Corporation
MFC after:	1 week
This commit is contained in:
Justin T. Gibbs 2013-05-31 04:45:59 +00:00
parent 5e58295a1f
commit e3242f9d08

View File

@ -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