xen-netfront: remove useless NULL check in netif_free

xn_ifp is allocated in create_netdev with if_alloc(IFT_ETHER).
According to the current arrangement it can't be NULL.

Coverity ID:		1349805
Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Sponsored by:		Citrix Systems R&D
Differential revision:	https://reviews.freebsd.org/D5252
This commit is contained in:
royger 2016-02-11 11:57:12 +00:00
parent 95c8add1f2
commit 79662ff85e

View File

@ -2280,11 +2280,9 @@ netif_free(struct netfront_info *np)
netif_disconnect_backend(np);
free(np->rxq, M_DEVBUF);
free(np->txq, M_DEVBUF);
if (np->xn_ifp != NULL) {
ether_ifdetach(np->xn_ifp);
if_free(np->xn_ifp);
np->xn_ifp = NULL;
}
ether_ifdetach(np->xn_ifp);
if_free(np->xn_ifp);
np->xn_ifp = NULL;
ifmedia_removeall(&np->sc_media);
}