1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-22 15:47:37 +00:00

Only tear down interface and transport if they've been successfully setup.

Approved by:	jimharris
Sponsored by:	Intel
This commit is contained in:
Carl Delsey 2013-09-05 23:12:58 +00:00
parent 218b961f0e
commit 538779c1a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=255280

View File

@ -334,14 +334,19 @@ ntb_setup_interface()
static int
ntb_teardown_interface()
{
struct ifnet *ifp = net_softc.ifp;
ntb_transport_link_down(net_softc.qp);
if (net_softc.qp != NULL)
ntb_transport_link_down(net_softc.qp);
ether_ifdetach(ifp);
if_free(ifp);
ntb_transport_free_queue(net_softc.qp);
ntb_transport_free(&net_softc);
if (net_softc.ifp != NULL) {
ether_ifdetach(net_softc.ifp);
if_free(net_softc.ifp);
}
if (net_softc.qp != NULL) {
ntb_transport_free_queue(net_softc.qp);
ntb_transport_free(&net_softc);
}
return (0);
}