summaryrefslogtreecommitdiffstats
path: root/sys/dev/ex
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-09-16 11:25:19 +0000
committerru <ru@FreeBSD.org>2005-09-16 11:25:19 +0000
commitffd86537c18a9461b7ba5750e9c1614efab9e102 (patch)
tree28693ec03ccca1e33bd2724f25f53e25086d4948 /sys/dev/ex
parentc71407b5890e69c4a1adc0e0936f0d7e9cd24be4 (diff)
downloadFreeBSD-src-ffd86537c18a9461b7ba5750e9c1614efab9e102.zip
FreeBSD-src-ffd86537c18a9461b7ba5750e9c1614efab9e102.tar.gz
Fix "struct ifnet" leaks when attach() fails in the middle.
Diffstat (limited to 'sys/dev/ex')
-rw-r--r--sys/dev/ex/if_ex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c
index e3d4859..3c1296f 100644
--- a/sys/dev/ex/if_ex.c
+++ b/sys/dev/ex/if_ex.c
@@ -196,6 +196,9 @@ ex_release_resources(device_t dev)
sc->irq = NULL;
}
+ if (sc->ifp)
+ if_free(sc->ifp);
+
return;
}
@@ -276,7 +279,6 @@ ex_detach(device_t dev)
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ether_ifdetach(ifp);
- if_free(ifp);
ex_release_resources(dev);
OpenPOWER on IntegriCloud