summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2004-11-03 17:14:32 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2004-11-03 17:14:32 +0000
commit04537a148a8f72b1b13055c4f90985e3a8ad6c7c (patch)
tree1dfb8cb159b79508e49237a66fa118d292b1f5c3
parent45728544da8401bb99781193fa6e28e1d80d13d1 (diff)
Call ipw_stop() at the beginning of ipw_init(): this fixes a memory leak
when ipw_init() is called on ENETRESET. Call ipw_stop() when the radio transmitter is turned off. ok claudio@
-rw-r--r--sys/dev/pci/if_ipw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index deafcfa9fb4..8bbfef92621 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $Id: if_ipw.c,v 1.23 2004/11/03 17:12:28 damien Exp $ */
+/* $Id: if_ipw.c,v 1.24 2004/11/03 17:14:31 damien Exp $ */
/*-
* Copyright (c) 2004
@@ -524,7 +524,7 @@ ipw_newstate_intr(struct ipw_softc *sc, struct ipw_soft_buf *sbuf)
break;
case IPW_STATE_RADIO_DISABLED:
- /* XXX should turn the interface down */
+ ipw_stop(&ic->ic_if, 1);
break;
}
}
@@ -2009,6 +2009,8 @@ ipw_init(struct ifnet *ifp)
return EIO;
}
+ ipw_stop(ifp, 0);
+
if ((error = ipw_reset(sc)) != 0) {
printf("%s: could not reset adapter\n", sc->sc_dev.dv_xname);
goto fail;