summaryrefslogtreecommitdiffstats
path: root/sys/dev/cnw/if_cnw.c
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/cnw/if_cnw.c
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/cnw/if_cnw.c')
-rw-r--r--sys/dev/cnw/if_cnw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/cnw/if_cnw.c b/sys/dev/cnw/if_cnw.c
index 900feb9..5db732d 100644
--- a/sys/dev/cnw/if_cnw.c
+++ b/sys/dev/cnw/if_cnw.c
@@ -1627,6 +1627,7 @@ static int cnw_pccard_attach(device_t dev)
error = cnw_alloc(dev);
if (error) {
device_printf(dev, "cnw_alloc() failed! (%d)\n", error);
+ if_free(ifp);
return (error);
}
@@ -1636,6 +1637,7 @@ static int cnw_pccard_attach(device_t dev)
if (error) {
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
cnw_free(dev);
+ if_free(ifp);
return (error);
}
OpenPOWER on IntegriCloud