summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_ipw.c
diff options
context:
space:
mode:
authordaniel <daniel@openbsd.org>2014-03-27 11:32:29 +0000
committerdaniel <daniel@openbsd.org>2014-03-27 11:32:29 +0000
commitaf0daea8b94e421597bf7ee167ffe378671e915e (patch)
tree5003660cb241e59768402f3f792289fcabb4a32b /sys/dev/pci/if_ipw.c
parenteverything is at least 4 byte aligned (diff)
downloadwireguard-openbsd-af0daea8b94e421597bf7ee167ffe378671e915e.tar.xz
wireguard-openbsd-af0daea8b94e421597bf7ee167ffe378671e915e.zip
fix a theoretical double free.
ok tedu@
Diffstat (limited to 'sys/dev/pci/if_ipw.c')
-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 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;
}