aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2005-09-16 12:49:06 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2005-09-16 12:49:06 +0000
commitfead0681ed4fa30c5daddc6df7e166f75d6616a9 (patch)
tree37bb8214143d6412a18d105093193e832785d2d8 /sys/contrib
parentffdd61c31d5676e5018ee26c7813d504dbdfa8fb (diff)
downloadsrc-fead0681ed4fa30c5daddc6df7e166f75d6616a9.tar.gz
src-fead0681ed4fa30c5daddc6df7e166f75d6616a9.zip
Fix "struct ifnet" leak if attach() fails in the middle.
Notes
Notes: svn path=/head/; revision=150220
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/dev/oltr/if_oltr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c
index d74663316517..ced116c585c4 100644
--- a/sys/contrib/dev/oltr/if_oltr.c
+++ b/sys/contrib/dev/oltr/if_oltr.c
@@ -152,12 +152,14 @@ oltr_attach(device_t dev)
RF_ACTIVE | RF_SHAREABLE : RF_ACTIVE);
if (sc->irq_res == NULL) {
device_printf(dev, "couldn't map interrupt\n");
+ if_free(ifp);
return (-1);
}
if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, oltr_intr,
sc, &sc-> oltr_intrhand)) {
device_printf(dev, "couldn't setup interrupt\n");
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res);
+ if_free(ifp);
return (-1);
}