diff options
author | gibbs <gibbs@FreeBSD.org> | 2013-05-31 04:45:59 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 2013-05-31 04:45:59 +0000 |
commit | 8e4a664c2cd6b450743448f7c260c36ece78012b (patch) | |
tree | c09a48df142fb03cc3a053007e0c7aa3328ad983 /sys/dev | |
parent | 526f3ad11acb296481215d7c2915b3f30f1844f6 (diff) | |
download | FreeBSD-src-8e4a664c2cd6b450743448f7c260c36ece78012b.zip FreeBSD-src-8e4a664c2cd6b450743448f7c260c36ece78012b.tar.gz |
Make netif_free() safe to call on a partially initialized softc.
Sponsored by: Spectra Logic Corporation
MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/xen/netfront/netfront.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index 6548c04..6e3260d 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -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 |