summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2016-02-11 11:57:12 +0000
committerroyger <royger@FreeBSD.org>2016-02-11 11:57:12 +0000
commit79662ff85e2f870af1480dc9652fcbf2310912e1 (patch)
tree7b448d963e3ecf5dc68e8121f0058ed839d7171c /sys/dev
parent95c8add1f2e9d0cef6da55a3fc9985db68f23e21 (diff)
downloadFreeBSD-src-79662ff85e2f870af1480dc9652fcbf2310912e1.zip
FreeBSD-src-79662ff85e2f870af1480dc9652fcbf2310912e1.tar.gz
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
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/xen/netfront/netfront.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 296c940..41c70f1 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -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);
}
OpenPOWER on IntegriCloud