diff options
author | daniel <daniel@cvs.openbsd.org> | 2014-03-27 11:32:30 +0000 |
---|---|---|
committer | daniel <daniel@cvs.openbsd.org> | 2014-03-27 11:32:30 +0000 |
commit | 63016f7a23a6eff858d1265b464a3219d64d41f2 (patch) | |
tree | eb159ee11fbe6295ed9c4484e0d3fb014b7ec351 /sys/dev/pci/if_ipw.c | |
parent | 6fe5b89fa3a4f4aef83d33b406b6396e34056ebc (diff) |
fix a theoretical double free.
ok tedu@
Diffstat (limited to 'sys/dev/pci/if_ipw.c')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 62eeb716f79..62bc5188bb5 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.98 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.99 2014/03/27 11:32:29 daniel Exp $ */ /*- * Copyright (c) 2004-2008 @@ -2032,6 +2032,7 @@ ipw_init(struct ifnet *ifp) } sc->sc_flags |= IPW_FLAG_FW_INITED; free(fw.data, M_DEVBUF); + fw.data = NULL; /* retrieve information tables base addresses */ sc->table1_base = CSR_READ_4(sc, IPW_CSR_TABLE1_BASE); @@ -2042,7 +2043,7 @@ ipw_init(struct ifnet *ifp) if ((error = ipw_config(sc)) != 0) { printf("%s: device configuration failed\n", sc->sc_dev.dv_xname); - goto fail2; + goto fail1; } ifp->if_flags &= ~IFF_OACTIVE; @@ -2056,6 +2057,7 @@ ipw_init(struct ifnet *ifp) return 0; fail2: free(fw.data, M_DEVBUF); + fw.data = NULL; fail1: ipw_stop(ifp, 0); return error; } |