summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-08 07:14:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-09-08 07:14:05 +0000
commite7feec7ba38b0fa556832e09015184ec25caeeaa (patch)
tree8cdaee0df77f9477c4229b6e23136402178de40b
parent1c30b867b79adbab6af0c4f0dd0f7f22962018e4 (diff)
sizes for free(), when known; ok semarie
-rw-r--r--sys/arch/hppa/dev/apic.c4
-rw-r--r--sys/arch/hppa/gsc/harmony.c6
-rw-r--r--sys/arch/hppa/hppa/intr.c10
3 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/hppa/dev/apic.c b/sys/arch/hppa/dev/apic.c
index 7196b9207a9..debdc31480b 100644
--- a/sys/arch/hppa/dev/apic.c
+++ b/sys/arch/hppa/dev/apic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apic.c,v 1.17 2015/08/12 05:39:36 mlarkin Exp $ */
+/* $OpenBSD: apic.c,v 1.18 2015/09/08 07:14:04 deraadt Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -175,7 +175,7 @@ apic_intr_establish(void *v, pci_intr_handle_t ih,
cnt = malloc(sizeof(struct evcount), M_DEVBUF, M_NOWAIT);
if (!cnt) {
- free(aiv, M_DEVBUF, 0);
+ free(aiv, M_DEVBUF, sizeof *aiv);
return (NULL);
}
diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c
index c54836d5848..853745aefb1 100644
--- a/sys/arch/hppa/gsc/harmony.c
+++ b/sys/arch/hppa/gsc/harmony.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: harmony.c,v 1.30 2015/05/11 06:46:21 ratchov Exp $ */
+/* $OpenBSD: harmony.c,v 1.31 2015/09/08 07:14:04 deraadt Exp $ */
/*
* Copyright (c) 2003 Jason L. Wright (jason@thought.net)
@@ -921,7 +921,7 @@ fail3:
fail2:
bus_dmamap_destroy(sc->sc_dmat, d->d_map);
fail1:
- free(d, pool, 0);
+ free(d, pool, sizeof *d);
fail:
return (NULL);
}
@@ -939,7 +939,7 @@ harmony_freem(void *vsc, void *ptr, int pool)
bus_dmamem_unmap(sc->sc_dmat, d->d_kva, d->d_size);
bus_dmamem_free(sc->sc_dmat, &d->d_seg, 1);
bus_dmamap_destroy(sc->sc_dmat, d->d_map);
- free(d, pool, 0);
+ free(d, pool, sizeof *d);
return;
}
printf("%s: free rogue pointer\n", sc->sc_dv.dv_xname);
diff --git a/sys/arch/hppa/hppa/intr.c b/sys/arch/hppa/hppa/intr.c
index 5c0ee090d52..e39b519e21f 100644
--- a/sys/arch/hppa/hppa/intr.c
+++ b/sys/arch/hppa/hppa/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.47 2015/04/28 18:39:13 kettenis Exp $ */
+/* $OpenBSD: intr.c,v 1.48 2015/09/08 07:14:04 deraadt Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -164,7 +164,7 @@ cpu_intr_map(void *v, int pri, int irq, int (*handler)(void *), void *arg,
iv = &ivb[irq];
if (iv->handler) {
if (!pv->share) {
- free(cnt, M_DEVBUF, 0);
+ free(cnt, M_DEVBUF, sizeof *cnt);
return (NULL);
} else {
iv = pv->share;
@@ -225,10 +225,10 @@ cpu_intr_establish(int pri, int irq, int (*handler)(void *), void *arg,
intr_more += 2 * CPU_NINTS;
for (ev = iv->next + CPU_NINTS; ev < intr_more; ev++)
ev->share = iv->share, iv->share = ev;
- free(cnt, M_DEVBUF, 0);
+ free(cnt, M_DEVBUF, sizeof *cnt);
iv->cnt = NULL;
} else if (name == NULL) {
- free(cnt, M_DEVBUF, 0);
+ free(cnt, M_DEVBUF, sizeof *cnt);
iv->cnt = NULL;
} else
evcount_attach(cnt, name, NULL);
@@ -361,7 +361,7 @@ softintr_disestablish(void *cookie)
iv->handler = nv->handler;
iv->arg = nv->arg;
iv->next = nv->next;
- free(nv, M_DEVBUF, 0);
+ free(nv, M_DEVBUF, sizeof *nv);
return;
} else {
iv->handler = NULL;