diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-12 18:44:44 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-12 18:44:44 +0000 |
commit | 48b6cac396e42c57b5037f5a67d6cd7afb1733d6 (patch) | |
tree | 29d721c60c102e5fb6ed78e8ad45bbda321c951f | |
parent | a29a93ecbd0d69878182d5959b330ae5badcadc7 (diff) |
add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.
317 files changed, 1319 insertions, 1319 deletions
diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c index 9507cfe3ffb..d38ad4e22ae 100644 --- a/sys/arch/alpha/alpha/interrupt.c +++ b/sys/arch/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.32 2014/01/26 17:40:09 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.33 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */ /*- @@ -586,7 +586,7 @@ softintr_disestablish(void *arg) } mtx_leave(&asi->softintr_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c index 3d4f2ad546d..0c9d0c0ff08 100644 --- a/sys/arch/alpha/dev/bus_dma.c +++ b/sys/arch/alpha/dev/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.32 2014/07/11 09:36:25 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.33 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */ /*- @@ -112,7 +112,7 @@ _bus_dmamap_destroy(t, map) bus_dmamap_t map; { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/alpha/dev/sgmap_common.c b/sys/arch/alpha/dev/sgmap_common.c index 11d26b8b48b..af751a93b10 100644 --- a/sys/arch/alpha/dev/sgmap_common.c +++ b/sys/arch/alpha/dev/sgmap_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgmap_common.c,v 1.12 2014/06/14 23:11:20 jmatthew Exp $ */ +/* $OpenBSD: sgmap_common.c,v 1.13 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: sgmap_common.c,v 1.13 2000/06/29 09:02:57 mrg Exp $ */ /*- @@ -187,7 +187,7 @@ void alpha_sgmap_dmamap_teardown(map) bus_dmamap_t map; { - free(map->_dm_cookie, M_DEVBUF); + free(map->_dm_cookie, M_DEVBUF, 0); } void diff --git a/sys/arch/alpha/dev/shared_intr.c b/sys/arch/alpha/dev/shared_intr.c index 847541c8a9a..c8ef5c2256c 100644 --- a/sys/arch/alpha/dev/shared_intr.c +++ b/sys/arch/alpha/dev/shared_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shared_intr.c,v 1.18 2011/04/15 20:40:05 deraadt Exp $ */ +/* $OpenBSD: shared_intr.c,v 1.19 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: shared_intr.c,v 1.13 2000/03/19 01:46:18 thorpej Exp $ */ /* @@ -196,7 +196,7 @@ alpha_shared_intr_disestablish(intr, cookie) */ evcount_detach(&ih->ih_count); TAILQ_REMOVE(&intr[num].intr_q, ih, ih_q); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } int diff --git a/sys/arch/alpha/eisa/eisa_machdep.c b/sys/arch/alpha/eisa/eisa_machdep.c index 40058e7738b..8da7288638d 100644 --- a/sys/arch/alpha/eisa/eisa_machdep.c +++ b/sys/arch/alpha/eisa/eisa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eisa_machdep.c,v 1.4 2013/07/17 13:57:24 martin Exp $ */ +/* $OpenBSD: eisa_machdep.c,v 1.5 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: eisa_machdep.c,v 1.1 2000/07/29 23:18:47 thorpej Exp $ */ /*- @@ -572,8 +572,8 @@ eisa_init(eisa_chipset_tag_t ec) } } - free(cdata, M_TEMP); - free(data, M_TEMP); + free(cdata, M_TEMP, 0); + free(data, M_TEMP, 0); } /* diff --git a/sys/arch/alpha/isa/isadma_bounce.c b/sys/arch/alpha/isa/isadma_bounce.c index bb05340dc01..e4cb07fdd71 100644 --- a/sys/arch/alpha/isa/isadma_bounce.c +++ b/sys/arch/alpha/isa/isadma_bounce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isadma_bounce.c,v 1.10 2010/11/20 20:58:49 miod Exp $ */ +/* $OpenBSD: isadma_bounce.c,v 1.11 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: isadma_bounce.c,v 1.3 2000/06/29 09:02:57 mrg Exp $ */ /*- @@ -171,7 +171,7 @@ isadma_bounce_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, out: if (error) { if (map->_dm_cookie != NULL) - free(map->_dm_cookie, M_DEVBUF); + free(map->_dm_cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } return (error); @@ -191,7 +191,7 @@ isadma_bounce_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) if (cookie->id_flags & ID_HAS_BOUNCE) isadma_bounce_free_bouncebuf(t, map); - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } diff --git a/sys/arch/alpha/stand/boot/disk.c b/sys/arch/alpha/stand/boot/disk.c index 1683e75160a..2ad6b590749 100644 --- a/sys/arch/alpha/stand/boot/disk.c +++ b/sys/arch/alpha/stand/boot/disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disk.c,v 1.13 2013/11/12 01:37:40 krw Exp $ */ +/* $OpenBSD: disk.c,v 1.14 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: disk.c,v 1.6 1997/04/06 08:40:33 cgd Exp $ */ /* @@ -156,7 +156,7 @@ diskopen(f, ctlr, unit, part) if (part >= lp->d_npartitions || DL_GETPSIZE(&lp->d_partitions[part]) == 0) { -bad: free(sc, sizeof(struct disk_softc)); +bad: free(sc, sizeof(struct disk_softc), 0); return (ENXIO); } return (0); @@ -170,7 +170,7 @@ diskclose(f) sc = f->f_devdata; (void)prom_close(sc->sc_fd); - free(sc, sizeof(struct disk_softc)); + free(sc, sizeof(struct disk_softc), 0); f->f_devdata = NULL; return (0); } diff --git a/sys/arch/alpha/stand/installboot.c b/sys/arch/alpha/stand/installboot.c index 57e039a55b1..9becc1ce7a8 100644 --- a/sys/arch/alpha/stand/installboot.c +++ b/sys/arch/alpha/stand/installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: installboot.c,v 1.17 2013/06/11 16:42:06 deraadt Exp $ */ +/* $OpenBSD: installboot.c,v 1.18 2014/07/12 18:44:40 tedu Exp $ */ /* $NetBSD: installboot.c,v 1.2 1997/04/06 08:41:12 cgd Exp $ */ /* @@ -258,7 +258,7 @@ loadprotoblocks(char *fname, long *size) } if (read(fd, bp, statbuf.st_size) != statbuf.st_size) { warn("read: %s", fname); - free(bp); + free(bp, 0); close(fd); return NULL; } diff --git a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c index 02381d36ff0..30e71e88c5a 100644 --- a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c +++ b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setnetbootinfo.c,v 1.2 2003/05/11 19:41:09 deraadt Exp $ */ +/* $OpenBSD: setnetbootinfo.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: setnetbootinfo.c,v 1.5 1997/04/06 08:41:37 cgd Exp $ */ /* @@ -244,9 +244,9 @@ main(argc, argv) printf("closing %s...\n", outfilename); close(fd); - free(netbb); + free(netbb, 0); if (outfile == NULL) - free(outfilename); + free(outfilename, 0); exit (0); } diff --git a/sys/arch/amd64/amd64/aesni.c b/sys/arch/amd64/amd64/aesni.c index 5ef36080817..a107ef602a5 100644 --- a/sys/arch/amd64/amd64/aesni.c +++ b/sys/arch/amd64/amd64/aesni.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aesni.c,v 1.26 2014/01/18 23:17:24 mikeb Exp $ */ +/* $OpenBSD: aesni.c,v 1.27 2014/07/12 18:44:41 tedu Exp $ */ /*- * Copyright (c) 2003 Jason Wright * Copyright (c) 2003, 2004 Theo de Raadt @@ -162,7 +162,7 @@ aesni_setup(void) aesni_sc->sc_cid = crypto_get_driverid(0); if (aesni_sc->sc_cid < 0) { - free(aesni_sc, M_DEVBUF); + free(aesni_sc, M_DEVBUF, 0); return; } @@ -352,12 +352,12 @@ aesni_freesession(u_int64_t tid) if (ses->ses_ghash) { explicit_bzero(ses->ses_ghash, sizeof(GHASH_CTX)); - free(ses->ses_ghash, M_CRYPTO_DATA); + free(ses->ses_ghash, M_CRYPTO_DATA, 0); } if (ses->ses_xts) { explicit_bzero(ses->ses_xts, sizeof(struct aesni_xts_ctx)); - free(ses->ses_xts, M_CRYPTO_DATA); + free(ses->ses_xts, M_CRYPTO_DATA, 0); } if (ses->ses_swd) { @@ -366,13 +366,13 @@ aesni_freesession(u_int64_t tid) if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA); + free(swd->sw_ictx, M_CRYPTO_DATA, 0); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA); + free(swd->sw_octx, M_CRYPTO_DATA, 0); } - free(swd, M_CRYPTO_DATA); + free(swd, M_CRYPTO_DATA, 0); } explicit_bzero(ses, sizeof (*ses)); @@ -411,7 +411,7 @@ aesni_encdec(struct cryptop *crp, struct cryptodesc *crd, if (crd->crd_len > aesni_sc->sc_buflen) { if (buf != NULL) { explicit_bzero(buf, aesni_sc->sc_buflen); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); } aesni_sc->sc_buflen = 0; diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c index 61a1c7cf82c..053a0305eeb 100644 --- a/sys/arch/amd64/amd64/bus_dma.c +++ b/sys/arch/amd64/amd64/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.44 2014/07/11 09:36:25 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.45 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */ /*- @@ -164,7 +164,7 @@ void _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/amd64/amd64/est.c b/sys/arch/amd64/amd64/est.c index c5b6d822669..86b465cc4d7 100644 --- a/sys/arch/amd64/amd64/est.c +++ b/sys/arch/amd64/amd64/est.c @@ -1,4 +1,4 @@ -/* $OpenBSD: est.c,v 1.32 2014/05/23 03:30:41 guenther Exp $ */ +/* $OpenBSD: est.c,v 1.33 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -255,7 +255,7 @@ est_acpi_init() return acpilist; notable: - free(acpilist, M_DEVBUF); + free(acpilist, M_DEVBUF, 0); acpilist = NULL; nolist: return NULL; @@ -283,7 +283,7 @@ est_acpi_pss_changed(struct acpicpu_pss *pss, int npss) M_DEVBUF, M_NOWAIT)) == NULL) { printf("est_acpi_pss_changed: cannot allocate memory for new " "operating points"); - free(acpilist, M_DEVBUF); + free(acpilist, M_DEVBUF, 0); return; } @@ -294,8 +294,8 @@ est_acpi_pss_changed(struct acpicpu_pss *pss, int npss) needtran = 0; } - free(est_fqlist->table, M_DEVBUF); - free(est_fqlist, M_DEVBUF); + free(est_fqlist->table, M_DEVBUF, 0); + free(est_fqlist, M_DEVBUF, 0); est_fqlist = acpilist; if (needtran) { @@ -383,7 +383,7 @@ est_init(struct cpu_info *ci) if ((fake_table = malloc(sizeof(struct est_op) * 3, M_DEVBUF, M_NOWAIT)) == NULL) { - free(fake_fqlist, M_DEVBUF); + free(fake_fqlist, M_DEVBUF, 0); printf("%s: EST: cannot allocate memory for fake " "table\n", cpu_device); return; @@ -443,8 +443,8 @@ est_init(struct cpu_info *ci) return; nospeedstep: - free(est_fqlist->table, M_DEVBUF); - free(est_fqlist, M_DEVBUF); + free(est_fqlist->table, M_DEVBUF, 0); + free(est_fqlist, M_DEVBUF, 0); } void diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c index d66170e8bd2..e68ea50262a 100644 --- a/sys/arch/amd64/amd64/intr.c +++ b/sys/arch/amd64/amd64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.36 2014/03/29 18:09:28 guenther Exp $ */ +/* $OpenBSD: intr.c,v 1.37 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */ /* @@ -316,7 +316,7 @@ found: idtvec = idt_vec_alloc(APIC_LEVEL(level), IDT_INTR_HIGH); if (idtvec == 0) { simple_lock(&ci->ci_slock); - free(ci->ci_isources[slot], M_DEVBUF); + free(ci->ci_isources[slot], M_DEVBUF, 0); ci->ci_isources[slot] = NULL; simple_unlock(&ci->ci_slock); return EBUSY; @@ -377,7 +377,7 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, if (source->is_handlers != NULL && source->is_pic->pic_type != pic->pic_type) { - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); printf("intr_establish: can't share intr source between " "different PIC types (legacy_irq %d pin %d slot %d)\n", legacy_irq, pin, slot); @@ -405,7 +405,7 @@ intr_establish(int legacy_irq, struct pic *pic, int pin, int type, int level, printf("intr_establish: pic %s pin %d: can't share " "type %d with %d\n", pic->pic_name, pin, source->is_type, type); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); return NULL; } break; @@ -518,14 +518,14 @@ intr_disestablish(struct intrhand *ih) #endif if (source->is_handlers == NULL) { - free(source, M_DEVBUF); + free(source, M_DEVBUF, 0); ci->ci_isources[ih->ih_slot] = NULL; if (pic != &i8259_pic) idt_vec_free(idtvec); } evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); simple_unlock(&ci->ci_slock); } diff --git a/sys/arch/amd64/amd64/k1x-pstate.c b/sys/arch/amd64/amd64/k1x-pstate.c index ff43fc6a919..5dc66b1adcb 100644 --- a/sys/arch/amd64/amd64/k1x-pstate.c +++ b/sys/arch/amd64/amd64/k1x-pstate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: k1x-pstate.c,v 1.5 2013/10/05 18:47:05 brynet Exp $ */ +/* $OpenBSD: k1x-pstate.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2011 Bryan Steele <brynet@gmail.com> * @@ -200,5 +200,5 @@ k1x_init(struct cpu_info *ci) setperf_prio = 1; return; } - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); } diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c index 3961bdef896..80994991b5f 100644 --- a/sys/arch/amd64/amd64/mem.c +++ b/sys/arch/amd64/amd64/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.16 2013/12/19 21:30:02 deraadt Exp $ */ +/* $OpenBSD: mem.c,v 1.17 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 @@ -295,7 +295,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) if (!error) error = copyout(md, mo->mo_desc, nd * sizeof(struct mem_range_desc)); - free(md, M_MEMDESC); + free(md, M_MEMDESC, 0); } else { nd = mem_range_softc.mr_ndesc; } @@ -309,7 +309,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) md->mr_owner[sizeof(md->mr_owner) - 1] = 0; if (error == 0) error = mem_range_attr_set(md, &mo->mo_arg[0]); - free(md, M_MEMDESC); + free(md, M_MEMDESC, 0); break; } return (error); diff --git a/sys/arch/amd64/amd64/powernow-k8.c b/sys/arch/amd64/amd64/powernow-k8.c index 1e0875c9d05..a725e7a804a 100644 --- a/sys/arch/amd64/amd64/powernow-k8.c +++ b/sys/arch/amd64/amd64/powernow-k8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k8.c,v 1.22 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: powernow-k8.c,v 1.23 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2004 Martin Végiard. * Copyright (c) 2004-2005 Bruno Ducrot @@ -383,7 +383,7 @@ k8pnow_acpi_pss_changed(struct acpicpu_pss * pss, int npss) if (needtran) k8pnow_transition(nstate, curs); - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); k8pnow_current_state = nstate; } @@ -513,5 +513,5 @@ k8_powernow_init(struct cpu_info *ci) setperf_prio = 1; return; } - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); } diff --git a/sys/arch/amd64/amd64/softintr.c b/sys/arch/amd64/amd64/softintr.c index b0d22813c76..3b50c59b556 100644 --- a/sys/arch/amd64/amd64/softintr.c +++ b/sys/arch/amd64/amd64/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.5 2009/04/19 19:13:57 oga Exp $ */ +/* $OpenBSD: softintr.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */ /*- @@ -157,5 +157,5 @@ softintr_disestablish(void *arg) } mtx_leave(&si->softintr_lock); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c index 31bb1c0837e..543f2b643df 100644 --- a/sys/arch/amd64/amd64/via.c +++ b/sys/arch/amd64/amd64/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.15 2014/03/29 18:09:28 guenther Exp $ */ +/* $OpenBSD: via.c,v 1.16 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -118,7 +118,7 @@ viac3_crypto_setup(void) vc3_sc->sc_cid = crypto_get_driverid(0); if (vc3_sc->sc_cid < 0) { - free(vc3_sc, M_DEVBUF); + free(vc3_sc, M_DEVBUF, 0); return; /* YYY bitch? */ } @@ -162,7 +162,7 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri) return (ENOMEM); bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses)); explicit_bzero(sc->sc_sessions, sesn * sizeof(*ses)); - free(sc->sc_sessions, M_DEVBUF); + free(sc->sc_sessions, M_DEVBUF, 0); sc->sc_sessions = ses; ses = &sc->sc_sessions[sesn]; sc->sc_nsessions++; @@ -302,13 +302,13 @@ viac3_crypto_freesession(u_int64_t tid) if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA); + free(swd->sw_ictx, M_CRYPTO_DATA, 0); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA); + free(swd->sw_octx, M_CRYPTO_DATA, 0); } - free(swd, M_CRYPTO_DATA); + free(swd, M_CRYPTO_DATA, 0); } explicit_bzero(&sc->sc_sessions[sesn], sizeof(sc->sc_sessions[sesn])); @@ -429,7 +429,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd, if (sc->op_buf != NULL) { explicit_bzero(sc->op_buf, crd->crd_len); - free(sc->op_buf, M_DEVBUF); + free(sc->op_buf, M_DEVBUF, 0); sc->op_buf = NULL; } diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c index 07b1d891d87..eb5f22629f4 100644 --- a/sys/arch/amd64/isa/isa_machdep.c +++ b/sys/arch/amd64/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.22 2010/11/20 20:58:51 miod Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.23 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ #define ISA_DMA_STATS @@ -452,7 +452,7 @@ _isa_bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, out: if (error) { if (map->_dm_cookie != NULL) - free(map->_dm_cookie, M_DEVBUF); + free(map->_dm_cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } return (error); @@ -472,7 +472,7 @@ _isa_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) if (cookie->id_flags & ID_HAS_BOUNCE) _isa_dma_free_bouncebuf(t, map); - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } diff --git a/sys/arch/amd64/pci/agp_machdep.c b/sys/arch/amd64/pci/agp_machdep.c index 0634fa7e4e3..669b56d15f8 100644 --- a/sys/arch/amd64/pci/agp_machdep.c +++ b/sys/arch/amd64/pci/agp_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_machdep.c,v 1.11 2014/04/01 09:05:03 mpi Exp $ */ +/* $OpenBSD: agp_machdep.c,v 1.12 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2008 - 2009 Owain G. Ainsworth <oga@openbsd.org> @@ -90,7 +90,7 @@ agp_init_map(bus_space_tag_t tag, bus_addr_t address, bus_size_t size, map->size = size; if ((err = bus_space_map(tag, address, size, flags, &map->bsh)) != 0) { - free(map, M_AGP); + free(map, M_AGP, 0); return (err); } *mapp = map; @@ -101,7 +101,7 @@ void agp_destroy_map(struct agp_map *map) { bus_space_unmap(map->bst, map->bsh, map->size); - free(map, M_AGP); + free(map, M_AGP, 0); } diff --git a/sys/arch/amd64/pci/vga_post.c b/sys/arch/amd64/pci/vga_post.c index 821bc1e3d62..ccef775ea7d 100644 --- a/sys/arch/amd64/pci/vga_post.c +++ b/sys/arch/amd64/pci/vga_post.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_post.c,v 1.6 2014/04/08 09:02:51 mpi Exp $ */ +/* $OpenBSD: vga_post.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */ /*- @@ -142,7 +142,7 @@ vga_post_init(int bus, int device, int function) &sc->ram_backing, BASE_MEMORY/PAGE_SIZE, UVM_PLA_WAITOK); if (err) { uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return NULL; } @@ -212,7 +212,7 @@ vga_post_free(struct vga_post *sc) pmap_kremove(sc->sys_image, 1024 * 1024); uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); pmap_update(pmap_kernel()); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); } #ifdef DDB diff --git a/sys/arch/amd64/stand/libsa/diskprobe.c b/sys/arch/amd64/stand/libsa/diskprobe.c index 50062579d5d..7a64b298ca6 100644 --- a/sys/arch/amd64/stand/libsa/diskprobe.c +++ b/sys/arch/amd64/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.13 2013/11/05 00:51:58 krw Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.14 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -79,7 +79,7 @@ floppyprobe(void) if (debug) printf(" <!fd%u>", i); #endif - free(dip, 0); + free(dip, 0, 0); break; } @@ -122,7 +122,7 @@ hardprobe(void) if (debug) printf(" <!hd%u>", i&0x7f); #endif - free(dip, 0); + free(dip, 0, 0); break; } @@ -234,7 +234,7 @@ cdprobe(void) #if 0 if (bios_getdiskinfo(cddev, &dip->bios_info)) { printf(" <!cd0>"); /* XXX */ - free(dip, 0); + free(dip, 0, 0); return; } #endif diff --git a/sys/arch/amd64/stand/libsa/softraid.c b/sys/arch/amd64/stand/libsa/softraid.c index 5c7f9b3104e..15679a72b35 100644 --- a/sys/arch/amd64/stand/libsa/softraid.c +++ b/sys/arch/amd64/stand/libsa/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.6 2013/12/28 02:40:41 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2012 Joel Sing <jsing@openbsd.org> @@ -315,7 +315,7 @@ srprobe(void) } explicit_bzero(md, SR_META_SIZE * 512); - free(md, 0); + free(md, 0, 0); } int @@ -477,18 +477,18 @@ sr_clear_keys(void) continue; if (bv->sbv_keys != NULL) { explicit_bzero(bv->sbv_keys, SR_CRYPTO_KEYBLOCK_BYTES); - free(bv->sbv_keys, 0); + free(bv->sbv_keys, 0, 0); bv->sbv_keys = NULL; } if (bv->sbv_maskkey != NULL) { explicit_bzero(bv->sbv_maskkey, SR_CRYPTO_MAXKEYBYTES); - free(bv->sbv_maskkey, 0); + free(bv->sbv_maskkey, 0, 0); bv->sbv_maskkey = NULL; } } SLIST_FOREACH(kd, &sr_keydisks, kd_link) { explicit_bzero(kd, sizeof(*kd)); - free(kd, 0); + free(kd, 0, 0); } } @@ -618,7 +618,7 @@ done: if (keys != NULL && rv != 0) { explicit_bzero(keys, SR_CRYPTO_KEYBLOCK_BYTES); - free(keys, 0); + free(keys, 0, 0); } return (rv); diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c index 1ef6d858ed3..164dbc642d7 100644 --- a/sys/arch/arm/arm/bus_dma.c +++ b/sys/arch/arm/arm/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.25 2014/07/11 09:36:25 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.26 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */ /*- @@ -173,7 +173,7 @@ _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) map->_dm_buftype = ARM32_BUFTYPE_INVALID; map->_dm_proc = NULL; - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/arm/arm/pmap7.c b/sys/arch/arm/arm/pmap7.c index bd973160779..f7be94c520b 100644 --- a/sys/arch/arm/arm/pmap7.c +++ b/sys/arch/arm/arm/pmap7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap7.c,v 1.14 2014/05/08 21:17:00 miod Exp $ */ +/* $OpenBSD: pmap7.c,v 1.15 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -758,7 +758,7 @@ pmap_free_l1(pmap_t pm) /* free backing va */ uvm_km_free(kernel_map, (vaddr_t)l1->l1_kva, L1_TABLE_SIZE); - free(l1, M_VMPMAP); + free(l1, M_VMPMAP, 0); } /* diff --git a/sys/arch/arm/arm/softintr.c b/sys/arch/arm/arm/softintr.c index b7b003687e6..ba10f2b49f0 100644 --- a/sys/arch/arm/arm/softintr.c +++ b/sys/arch/arm/arm/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.7 2010/12/21 14:56:23 claudio Exp $ */ +/* $OpenBSD: softintr.c,v 1.8 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -157,5 +157,5 @@ softintr_disestablish(void *arg) } mtx_leave(&siq->siq_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } diff --git a/sys/arch/arm/arm/undefined.c b/sys/arch/arm/arm/undefined.c index 66fb3266a76..23ef6539c0c 100644 --- a/sys/arch/arm/arm/undefined.c +++ b/sys/arch/arm/arm/undefined.c @@ -1,4 +1,4 @@ -/* $OpenBSD: undefined.c,v 1.5 2011/09/20 22:02:11 miod Exp $ */ +/* $OpenBSD: undefined.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: undefined.c,v 1.22 2003/11/29 22:21:29 bjh21 Exp $ */ /* @@ -98,7 +98,7 @@ remove_coproc_handler(void *cookie) struct undefined_handler *uh = cookie; LIST_REMOVE(uh, uh_link); - free(uh, M_TEMP); + free(uh, M_TEMP, 0); } diff --git a/sys/arch/arm/cortex/ampintc.c b/sys/arch/arm/cortex/ampintc.c index 538728eb1ef..747c9455158 100644 --- a/sys/arch/arm/cortex/ampintc.c +++ b/sys/arch/arm/cortex/ampintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ampintc.c,v 1.2 2013/09/06 21:40:28 patrick Exp $ */ +/* $OpenBSD: ampintc.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007,2009,2011 Dale Rahn <drahn@openbsd.org> * @@ -561,7 +561,7 @@ ampintc_intr_disestablish(void *cookie) TAILQ_REMOVE(&sc->sc_ampintc_handler[irqno].iq_list, ih, ih_list); if (ih->ih_name != NULL) evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); restore_interrupts(psw); #endif } diff --git a/sys/arch/arm/xscale/pxa2x0_gpio.c b/sys/arch/arm/xscale/pxa2x0_gpio.c index 23b77322da4..2cc410a10f4 100644 --- a/sys/arch/arm/xscale/pxa2x0_gpio.c +++ b/sys/arch/arm/xscale/pxa2x0_gpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_gpio.c,v 1.23 2014/05/08 21:17:00 miod Exp $ */ +/* $OpenBSD: pxa2x0_gpio.c,v 1.24 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: pxa2x0_gpio.c,v 1.2 2003/07/15 00:24:55 lukem Exp $ */ /* @@ -330,7 +330,7 @@ pxa2x0_gpio_intr_disestablish(void *cookie) #endif /* PXAGPIO_HAS_GPION_INTRS */ } - free(gh, M_DEVBUF); + free(gh, M_DEVBUF, 0); } #ifdef PXAGPIO_HAS_GPION_INTRS diff --git a/sys/arch/arm/xscale/pxa2x0_i2s.c b/sys/arch/arm/xscale/pxa2x0_i2s.c index e4baef152fb..ccefc84081b 100644 --- a/sys/arch/arm/xscale/pxa2x0_i2s.c +++ b/sys/arch/arm/xscale/pxa2x0_i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_i2s.c,v 1.7 2006/04/04 11:45:40 pascoe Exp $ */ +/* $OpenBSD: pxa2x0_i2s.c,v 1.8 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org> @@ -225,7 +225,7 @@ fail_create: fail_map: bus_dmamem_free(sc->sc_dmat, &p->seg, 1); fail_alloc: - free(p, type); + free(p, type, 0); return 0; } @@ -244,7 +244,7 @@ pxa2x0_i2s_freem(void *hdl, void *ptr, int type) bus_dmamem_free(sc->sc_dmat, &p->seg, 1); *pp = p->next; - free(p, type); + free(p, type, 0); return; } diff --git a/sys/arch/arm/xscale/pxa2x0_intr.c b/sys/arch/arm/xscale/pxa2x0_intr.c index 633436b4c36..72d41a3f2b5 100644 --- a/sys/arch/arm/xscale/pxa2x0_intr.c +++ b/sys/arch/arm/xscale/pxa2x0_intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_intr.c,v 1.25 2014/05/08 21:17:00 miod Exp $ */ +/* $OpenBSD: pxa2x0_intr.c,v 1.26 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: pxa2x0_intr.c,v 1.5 2003/07/15 00:24:55 lukem Exp $ */ /* @@ -590,7 +590,7 @@ pxa2x0_intr_disestablish(void *cookie) psw = disable_interrupts(I32_bit); TAILQ_REMOVE(&handler[irqno].list, ih, ih_list); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); pxa2x0_update_intr_masks(); diff --git a/sys/arch/arm/xscale/pxa2x0_lcd.c b/sys/arch/arm/xscale/pxa2x0_lcd.c index ab17e2b69f9..119782c61d3 100644 --- a/sys/arch/arm/xscale/pxa2x0_lcd.c +++ b/sys/arch/arm/xscale/pxa2x0_lcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_lcd.c,v 1.25 2013/10/21 10:36:09 miod Exp $ */ +/* $OpenBSD: pxa2x0_lcd.c,v 1.26 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: pxa2x0_lcd.c,v 1.8 2003/10/03 07:24:05 bsh Exp $ */ /* @@ -703,7 +703,7 @@ pxa2x0_lcd_alloc_screen(void *v, const struct wsscreen_descr *_type, error = pxa2x0_lcd_new_screen(sc, scr, type->depth); if (error != 0) { - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return (error); } @@ -751,7 +751,7 @@ pxa2x0_lcd_free_screen(void *v, void *cookie) if (scr->nsegs > 0) bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); } int diff --git a/sys/arch/armv7/omap/intc.c b/sys/arch/armv7/omap/intc.c index 82971096c82..8c662a70f05 100644 --- a/sys/arch/armv7/omap/intc.c +++ b/sys/arch/armv7/omap/intc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intc.c,v 1.2 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: intc.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -380,7 +380,7 @@ intc_intr_disestablish(void *cookie) TAILQ_REMOVE(&intc_handler[irqno].iq_list, ih, ih_list); if (ih->ih_name != NULL) evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); restore_interrupts(psw); } diff --git a/sys/arch/armv7/omap/omdisplay.c b/sys/arch/armv7/omap/omdisplay.c index 1a6a31ed852..7fe18c08881 100644 --- a/sys/arch/armv7/omap/omdisplay.c +++ b/sys/arch/armv7/omap/omdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omdisplay.c,v 1.4 2013/12/11 12:51:51 naddy Exp $ */ +/* $OpenBSD: omdisplay.c,v 1.5 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007 Dale Rahn <drahn@openbsd.org> * @@ -1157,7 +1157,7 @@ omdisplay_alloc_screen(void *v, const struct wsscreen_descr *_type, error = omdisplay_new_screen(sc, scr, type->depth); if (error != 0) { - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return (error); } @@ -1337,7 +1337,7 @@ omdisplay_free_screen(void *v, void *cookie) if (scr->nsegs > 0) bus_dmamem_free(sc->sc_dma_tag, scr->segs, scr->nsegs); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); } int diff --git a/sys/arch/armv7/omap/omgpio.c b/sys/arch/armv7/omap/omgpio.c index 54138a8d601..66c9f39fa36 100644 --- a/sys/arch/armv7/omap/omgpio.c +++ b/sys/arch/armv7/omap/omgpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omgpio.c,v 1.3 2013/11/20 13:32:40 rapha Exp $ */ +/* $OpenBSD: omgpio.c,v 1.4 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -662,7 +662,7 @@ omgpio_intr_disestablish(struct omgpio_softc *sc, void *cookie) evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); omgpio_intr_level(gpio, IST_NONE); omgpio_intr_mask(gpio); diff --git a/sys/arch/armv7/sunxi/a1xintc.c b/sys/arch/armv7/sunxi/a1xintc.c index 68176bd0e48..f46c42ad3f7 100644 --- a/sys/arch/armv7/sunxi/a1xintc.c +++ b/sys/arch/armv7/sunxi/a1xintc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a1xintc.c,v 1.3 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: a1xintc.c,v 1.4 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2013 Artturi Alm @@ -417,7 +417,7 @@ intc_intr_disestablish(void *cookie) if (ih->ih_name != NULL) evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); er = bus_space_read_4(intc_iot, intc_ioh, INTC_ENABLE_REG(IRQ2REG32(irq))); diff --git a/sys/arch/aviion/aviion/bus_dma.c b/sys/arch/aviion/aviion/bus_dma.c index 0c34ad25df4..baba8f82370 100644 --- a/sys/arch/aviion/aviion/bus_dma.c +++ b/sys/arch/aviion/aviion/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.6 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */ /*- @@ -113,7 +113,7 @@ bus_dmamap_destroy(t, map) bus_dmamap_t map; { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/aviion/aviion/disksubr.c b/sys/arch/aviion/aviion/disksubr.c index bae953460af..d5f95c0b8b1 100644 --- a/sys/arch/aviion/aviion/disksubr.c +++ b/sys/arch/aviion/aviion/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.58 2013/10/19 09:32:13 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.59 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -450,7 +450,7 @@ readvditlabel(struct buf *bp, void (*strat)(struct buf *), struct disklabel *lp, } done: - free(vdit_storage, M_DEVBUF); + free(vdit_storage, M_DEVBUF, 0); if (sbp != NULL) { sbp->b_flags |= B_INVAL; brelse(sbp); diff --git a/sys/arch/aviion/dev/dma.c b/sys/arch/aviion/dev/dma.c index eedb46875f1..0555d99c1d6 100644 --- a/sys/arch/aviion/dev/dma.c +++ b/sys/arch/aviion/dev/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.1 2013/10/23 10:07:14 miod Exp $ */ +/* $OpenBSD: dma.c,v 1.2 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -139,7 +139,7 @@ dma_intr(void *v) if (req->cbdone != NULL) (*req->cbdone)(req->cbarg); - free(req, M_DEVBUF); + free(req, M_DEVBUF, 0); } else { req->mem += req->lastcnt; } diff --git a/sys/arch/aviion/dev/vme.c b/sys/arch/aviion/dev/vme.c index a5ba2f1e9ba..51af775adbc 100644 --- a/sys/arch/aviion/dev/vme.c +++ b/sys/arch/aviion/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.13 2014/05/08 22:17:33 miod Exp $ */ +/* $OpenBSD: vme.c,v 1.14 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2006, 2007, 2010 Miodrag Vallat. * @@ -836,7 +836,7 @@ vmebus_get_bst(struct device *vsc, u_int aspace, u_int dspace, void vmebus_release_bst(struct device *vsc, bus_space_tag_t b) { - free((void *)b, M_DEVBUF); + free((void *)b, M_DEVBUF, 0); } /* diff --git a/sys/arch/aviion/stand/a2coff/a2coff.c b/sys/arch/aviion/stand/a2coff/a2coff.c index c1d8737a7ac..6a2a3095d05 100644 --- a/sys/arch/aviion/stand/a2coff/a2coff.c +++ b/sys/arch/aviion/stand/a2coff/a2coff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a2coff.c,v 1.11 2014/05/31 21:04:34 miod Exp $ */ +/* $OpenBSD: a2coff.c,v 1.12 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2006, 2013, Miodrag Vallat * @@ -324,7 +324,7 @@ convert_elf(const char *infile, int infd, int outfd, Elf_Ehdr *ehdr) last = n; } - free(phdr); + free(phdr, 0); /* * Fill ``data'' section. diff --git a/sys/arch/aviion/stand/boot/oaic.c b/sys/arch/aviion/stand/boot/oaic.c index d3e50f42a14..e166c12e1df 100644 --- a/sys/arch/aviion/stand/boot/oaic.c +++ b/sys/arch/aviion/stand/boot/oaic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oaic.c,v 1.1 2013/10/16 16:59:34 miod Exp $ */ +/* $OpenBSD: oaic.c,v 1.2 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2010, 2013 Miodrag Vallat. @@ -225,7 +225,7 @@ oaic_attach(uint32_t addr, int id, int lun) void oaic_detach(void *cookie) { - free(cookie, sizeof(struct aic6250_softc)); + free(cookie, sizeof(struct aic6250_softc), 0); } /* diff --git a/sys/arch/aviion/stand/boot/oosiop.c b/sys/arch/aviion/stand/boot/oosiop.c index 415f773a7ca..0757704e068 100644 --- a/sys/arch/aviion/stand/boot/oosiop.c +++ b/sys/arch/aviion/stand/boot/oosiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: oosiop.c,v 1.4 2013/10/16 16:59:34 miod Exp $ */ +/* $OpenBSD: oosiop.c,v 1.5 2014/07/12 18:44:41 tedu Exp $ */ /* OpenBSD: oosiop.c,v 1.20 2013/10/09 18:22:06 miod Exp */ /* OpenBSD: oosiopvar.h,v 1.5 2011/04/03 12:42:36 krw Exp */ /* $NetBSD: oosiop.c,v 1.4 2003/10/29 17:45:55 tsutsui Exp $ */ @@ -214,8 +214,8 @@ oosiop_detach(void *cookie) { struct oosiop_softc *sc = cookie; - free(sc->sc_scr, sizeof(oosiop_script)); - free(sc, sizeof *sc); + free(sc->sc_scr, sizeof(oosiop_script), 0); + free(sc, sizeof *sc, 0); } static __inline void diff --git a/sys/arch/aviion/stand/boot/scsi.c b/sys/arch/aviion/stand/boot/scsi.c index 72f8cd4bb52..bd00afef27e 100644 --- a/sys/arch/aviion/stand/boot/scsi.c +++ b/sys/arch/aviion/stand/boot/scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi.c,v 1.2 2013/10/16 16:59:34 miod Exp $ */ +/* $OpenBSD: scsi.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -93,7 +93,7 @@ scsi_initialize(const char *ctrlname, int ctrl, int unit, int lun, int part) done: if (priv->scsicookie == NULL) { - free(priv, sizeof(struct scsi_private)); + free(priv, sizeof(struct scsi_private), 0); priv = NULL; } diff --git a/sys/arch/aviion/stand/boot/sd.c b/sys/arch/aviion/stand/boot/sd.c index 4fe51f22513..2e01fae35d2 100644 --- a/sys/arch/aviion/stand/boot/sd.c +++ b/sys/arch/aviion/stand/boot/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.5 2013/10/16 16:59:34 miod Exp $ */ +/* $OpenBSD: sd.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -92,7 +92,7 @@ sdclose(struct open_file *f) priv = (struct scsi_private *)f->f_devdata; if (priv->scsicookie != NULL) (*priv->scsidetach)(priv->scsicookie); - free(priv, sizeof(struct scsi_private)); + free(priv, sizeof(struct scsi_private), 0); f->f_devdata = NULL; } diff --git a/sys/arch/aviion/stand/vdmtool/vdmtool.c b/sys/arch/aviion/stand/vdmtool/vdmtool.c index fb0c42ea2db..9a22b6136f8 100644 --- a/sys/arch/aviion/stand/vdmtool/vdmtool.c +++ b/sys/arch/aviion/stand/vdmtool/vdmtool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdmtool.c,v 1.2 2013/10/01 22:24:53 jmc Exp $ */ +/* $OpenBSD: vdmtool.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2013 Miodrag Vallat. @@ -534,7 +534,7 @@ read_vdit(int fd, uint32_t secno, size_t *vditsize) curbuf = append_vdit_portion(fd, secno, curbuf, sector, first ? VDIT_BLOCK_HEAD_BE : VDIT_PORTION_HEADER_BLOCK); if (curbuf == NULL) { - free(buf); + free(buf, 0); return NULL; } first = 0; @@ -606,10 +606,10 @@ report(int fd) } if (memcmp(vdit, vdit2, vditsize) != 0) printf("VDIT and backup VDIT differ!\n"); - free(vdit2); + free(vdit2, 0); } - free(vdit); + free(vdit, 0); } } diff --git a/sys/arch/hppa/dev/apic.c b/sys/arch/hppa/dev/apic.c index 0b88d7740f9..475517a2145 100644 --- a/sys/arch/hppa/dev/apic.c +++ b/sys/arch/hppa/dev/apic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apic.c,v 1.14 2011/05/01 21:59:39 kettenis Exp $ */ +/* $OpenBSD: apic.c,v 1.15 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -171,13 +171,13 @@ apic_intr_establish(void *v, pci_intr_handle_t ih, aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_NOWAIT); if (aiv == NULL) { - free(cnt, M_DEVBUF); + free(cnt, M_DEVBUF, 0); return NULL; } cnt = malloc(sizeof(struct evcount), M_DEVBUF, M_NOWAIT); if (!cnt) { - free(aiv, M_DEVBUF); + free(aiv, M_DEVBUF, 0); return (NULL); } diff --git a/sys/arch/hppa/dev/astro.c b/sys/arch/hppa/dev/astro.c index 802c7ae64b5..8628971f10a 100644 --- a/sys/arch/hppa/dev/astro.c +++ b/sys/arch/hppa/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.14 2014/02/08 20:41:48 kettenis Exp $ */ +/* $OpenBSD: astro.c,v 1.15 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -620,7 +620,7 @@ iommu_iomap_destroy(struct iommu_map_state *ims) ims->ims_map.ipm_pagecnt); #endif - free(ims, M_DEVBUF); + free(ims, M_DEVBUF, 0); } /* diff --git a/sys/arch/hppa/gsc/harmony.c b/sys/arch/hppa/gsc/harmony.c index 30991f0a9ad..2146781d858 100644 --- a/sys/arch/hppa/gsc/harmony.c +++ b/sys/arch/hppa/gsc/harmony.c @@ -1,4 +1,4 @@ -/* $OpenBSD: harmony.c,v 1.28 2013/05/15 08:29:23 ratchov Exp $ */ +/* $OpenBSD: harmony.c,v 1.29 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2003 Jason L. Wright (jason@thought.net) @@ -996,7 +996,7 @@ fail3: fail2: bus_dmamap_destroy(sc->sc_dmat, d->d_map); fail1: - free(d, pool); + free(d, pool, 0); fail: return (NULL); } @@ -1014,7 +1014,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); + free(d, pool, 0); 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 e51588a7854..69724de7419 100644 --- a/sys/arch/hppa/hppa/intr.c +++ b/sys/arch/hppa/hppa/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.43 2014/07/08 17:19:24 deraadt Exp $ */ +/* $OpenBSD: intr.c,v 1.44 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -163,7 +163,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); + free(cnt, M_DEVBUF, 0); return (NULL); } else { iv = pv->share; @@ -224,10 +224,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); + free(cnt, M_DEVBUF, 0); iv->cnt = NULL; } else if (name == NULL) { - free(cnt, M_DEVBUF); + free(cnt, M_DEVBUF, 0); iv->cnt = NULL; } else evcount_attach(cnt, name, NULL); @@ -360,7 +360,7 @@ softintr_disestablish(void *cookie) iv->handler = nv->handler; iv->arg = nv->arg; iv->next = nv->next; - free(nv, M_DEVBUF); + free(nv, M_DEVBUF, 0); return; } else { iv->handler = NULL; @@ -372,7 +372,7 @@ softintr_disestablish(void *cookie) for (iv = &intr_table[irq]; iv; iv = iv->next) { if (iv->next == cookie) { iv->next = iv->next->next; - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); return; } } diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c index 1b56adf65c1..3fa43c00216 100644 --- a/sys/arch/hppa/hppa/mainbus.c +++ b/sys/arch/hppa/hppa/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.84 2014/05/08 21:32:45 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.85 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -760,7 +760,7 @@ mbus_dmamap_destroy(void *v, bus_dmamap_t map) if (map->dm_mapsize != 0) mbus_dmamap_unload(v, map); - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/hppa/stand/libsa/lf.c b/sys/arch/hppa/stand/libsa/lf.c index fd70310c339..e70b005d80d 100644 --- a/sys/arch/hppa/stand/libsa/lf.c +++ b/sys/arch/hppa/stand/libsa/lf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lf.c,v 1.8 2013/03/24 19:20:35 deraadt Exp $ */ +/* $OpenBSD: lf.c,v 1.9 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -47,7 +47,7 @@ lfopen(struct open_file *f, ...) int lfclose(struct open_file *f) { - free(f->f_devdata, sizeof(struct hppa_dev)); + free(f->f_devdata, sizeof(struct hppa_dev), 0); f->f_devdata = NULL; return 0; } diff --git a/sys/arch/hppa64/dev/apic.c b/sys/arch/hppa64/dev/apic.c index 5b37a2c9ec9..ea6ec4727cd 100644 --- a/sys/arch/hppa64/dev/apic.c +++ b/sys/arch/hppa64/dev/apic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apic.c,v 1.6 2011/04/07 14:22:26 jsing Exp $ */ +/* $OpenBSD: apic.c,v 1.7 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -173,7 +173,7 @@ apic_intr_establish(void *v, pci_intr_handle_t ih, aiv = malloc(sizeof(struct apic_iv), M_DEVBUF, M_NOWAIT); if (aiv == NULL) { - free(cnt, M_DEVBUF); + free(cnt, M_DEVBUF, 0); return NULL; } @@ -186,7 +186,7 @@ apic_intr_establish(void *v, pci_intr_handle_t ih, if (apic_intr_list[irq]) { cnt = malloc(sizeof(struct evcount), M_DEVBUF, M_NOWAIT); if (!cnt) { - free(aiv, M_DEVBUF); + free(aiv, M_DEVBUF, 0); return (NULL); } diff --git a/sys/arch/hppa64/dev/astro.c b/sys/arch/hppa64/dev/astro.c index d6a5b4572c7..31eb75de2a9 100644 --- a/sys/arch/hppa64/dev/astro.c +++ b/sys/arch/hppa64/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.5 2011/04/07 15:30:15 miod Exp $ */ +/* $OpenBSD: astro.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -614,7 +614,7 @@ iommu_iomap_destroy(struct iommu_map_state *ims) ims->ims_map.ipm_pagecnt); #endif - free(ims, M_DEVBUF); + free(ims, M_DEVBUF, 0); } /* diff --git a/sys/arch/hppa64/hppa64/autoconf.c b/sys/arch/hppa64/hppa64/autoconf.c index c48261783b5..57cb571e8ac 100644 --- a/sys/arch/hppa64/hppa64/autoconf.c +++ b/sys/arch/hppa64/hppa64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.17 2013/10/04 18:46:07 kettenis Exp $ */ +/* $OpenBSD: autoconf.c,v 1.18 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1998-2005 Michael Shalayeff @@ -387,13 +387,13 @@ printf("num %ld ", pdc_pat_io_num.num); if ((err = pdc_call((iodcio_t)pdc, 0, PDC_PAT_IO, PDC_PAT_IO_GET_PCI_RT, rt, cell))) { printf("irt fetch error %d\n", err); - free(rt, M_DEVBUF); + free(rt, M_DEVBUF, 0); return (NULL); } } else if ((err = pdc_call((iodcio_t)pdc, 0, PDC_PCI_INDEX, PDC_PCI_GET_INT_TBL, &pdc_pat_io_num, cpu_gethpa(0), pdc_rt))) { printf("irt fetch error %d\n", err); - free(rt, M_DEVBUF); + free(rt, M_DEVBUF, 0); return (NULL); } bcopy(pdc_rt, rt, num * sizeof(*rt)); diff --git a/sys/arch/hppa64/hppa64/intr.c b/sys/arch/hppa64/hppa64/intr.c index 75601ac783e..6d318983c43 100644 --- a/sys/arch/hppa64/hppa64/intr.c +++ b/sys/arch/hppa64/hppa64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.9 2014/07/08 17:19:24 deraadt Exp $ */ +/* $OpenBSD: intr.c,v 1.10 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2002-2004 Michael Shalayeff @@ -132,7 +132,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); + free(cnt, M_DEVBUF, 0); return (NULL); } else { iv = pv->share; @@ -308,7 +308,7 @@ softintr_disestablish(void *cookie) iv->handler = nv->handler; iv->arg = nv->arg; iv->next = nv->next; - free(nv, M_DEVBUF); + free(nv, M_DEVBUF, 0); return; } else { iv->handler = NULL; @@ -320,7 +320,7 @@ softintr_disestablish(void *cookie) for (iv = &intr_table[irq]; iv; iv = iv->next) { if (iv->next == cookie) { iv->next = iv->next->next; - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); return; } } diff --git a/sys/arch/hppa64/hppa64/mainbus.c b/sys/arch/hppa64/hppa64/mainbus.c index c2261ad8a4a..e0995ff262c 100644 --- a/sys/arch/hppa64/hppa64/mainbus.c +++ b/sys/arch/hppa64/hppa64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.14 2014/04/08 09:34:23 mpi Exp $ */ +/* $OpenBSD: mainbus.c,v 1.15 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -334,7 +334,7 @@ mbus_dmamap_destroy(void *v, bus_dmamap_t map) if (map->dm_mapsize != 0) mbus_dmamap_unload(v, map); - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/hppa64/stand/libsa/lf.c b/sys/arch/hppa64/stand/libsa/lf.c index 514adcd89aa..39050d9d1bf 100644 --- a/sys/arch/hppa64/stand/libsa/lf.c +++ b/sys/arch/hppa64/stand/libsa/lf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lf.c,v 1.2 2013/03/24 19:20:35 deraadt Exp $ */ +/* $OpenBSD: lf.c,v 1.3 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -38,7 +38,7 @@ lfopen(struct open_file *f, ...) int lfclose(struct open_file *f) { - free(f->f_devdata, sizeof(struct hppa_dev)); + free(f->f_devdata, sizeof(struct hppa_dev), 0); f->f_devdata = NULL; return 0; } diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c index dcd22886699..1358197cd6b 100644 --- a/sys/arch/i386/i386/bus_dma.c +++ b/sys/arch/i386/i386/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.31 2014/07/11 14:41:00 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.32 2014/07/12 18:44:41 tedu Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. * All rights reserved. @@ -132,7 +132,7 @@ void _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c index bd34976ff04..5ca135acd25 100644 --- a/sys/arch/i386/i386/esm.c +++ b/sys/arch/i386/i386/esm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esm.c,v 1.54 2013/07/04 16:55:18 sf Exp $ */ +/* $OpenBSD: esm.c,v 1.55 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -875,7 +875,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap, s = malloc(sizeof(struct ksensor) * nsensors, M_DEVBUF, M_NOWAIT|M_ZERO); if (s == NULL) { - free(es, M_DEVBUF); + free(es, M_DEVBUF, 0); return; } @@ -893,7 +893,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap, s = malloc(sizeof(struct ksensor) * nsensors, M_DEVBUF, M_NOWAIT|M_ZERO); if (s == NULL) { - free(es, M_DEVBUF); + free(es, M_DEVBUF, 0); return; } @@ -909,7 +909,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap, case ESM_S_VOLTS: case ESM_S_VOLTSx10: if (esm_thresholds(sc, devmap, es) != 0) { - free(es, M_DEVBUF); + free(es, M_DEVBUF, 0); continue; } /* FALLTHROUGH */ @@ -919,7 +919,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap, s = malloc(sizeof(struct ksensor), M_DEVBUF, M_NOWAIT|M_ZERO); if (s == NULL) { - free(es, M_DEVBUF); + free(es, M_DEVBUF, 0); return; } diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c index 8321bdafce3..3e738556bfa 100644 --- a/sys/arch/i386/i386/est.c +++ b/sys/arch/i386/i386/est.c @@ -1,4 +1,4 @@ -/* $OpenBSD: est.c,v 1.42 2014/05/23 03:30:41 guenther Exp $ */ +/* $OpenBSD: est.c,v 1.43 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2003 Michael Eriksson. * All rights reserved. @@ -998,7 +998,7 @@ est_acpi_init() return acpilist; notable: - free(acpilist, M_DEVBUF); + free(acpilist, M_DEVBUF, 0); acpilist = NULL; nolist: return NULL; @@ -1026,7 +1026,7 @@ est_acpi_pss_changed(struct acpicpu_pss *pss, int npss) M_DEVBUF, M_NOWAIT)) == NULL) { printf("est_acpi_pss_changed: cannot allocate memory for new " "operating points"); - free(acpilist, M_DEVBUF); + free(acpilist, M_DEVBUF, 0); return; } @@ -1037,8 +1037,8 @@ est_acpi_pss_changed(struct acpicpu_pss *pss, int npss) needtran = 0; } - free(est_fqlist->table, M_DEVBUF); - free(est_fqlist, M_DEVBUF); + free(est_fqlist->table, M_DEVBUF, 0); + free(est_fqlist, M_DEVBUF, 0); est_fqlist = acpilist; if (needtran) { @@ -1142,7 +1142,7 @@ est_init(struct cpu_info *ci, int vendor) if ((fake_table = malloc(sizeof(struct est_op) * 3, M_DEVBUF, M_NOWAIT)) == NULL) { - free(fake_fqlist, M_DEVBUF); + free(fake_fqlist, M_DEVBUF, 0); printf("%s: EST: cannot allocate memory for fake " "table\n", cpu_device); return; @@ -1206,8 +1206,8 @@ nospeedstep: * While est_fqlist can point into the static est_cpus[], * it can't fail in that case and therefore can't reach here. */ - free(est_fqlist->table, M_DEVBUF); - free(est_fqlist, M_DEVBUF); + free(est_fqlist->table, M_DEVBUF, 0); + free(est_fqlist, M_DEVBUF, 0); } void diff --git a/sys/arch/i386/i386/ioapic.c b/sys/arch/i386/i386/ioapic.c index 415668023e3..ab58bbf2319 100644 --- a/sys/arch/i386/i386/ioapic.c +++ b/sys/arch/i386/i386/ioapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioapic.c,v 1.30 2013/10/01 20:22:11 sf Exp $ */ +/* $OpenBSD: ioapic.c,v 1.31 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: ioapic.c,v 1.7 2003/07/14 22:32:40 lukem Exp $ */ /*- @@ -709,7 +709,7 @@ apic_intr_establish(int irq, int type, int level, int (*ih_fun)(void *), /*printf("%s: intr_establish: can't share %s with %s, irq %d\n", ih_what, isa_intr_typename(pin->ip_type), isa_intr_typename(type), intr);*/ - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); return (NULL); } break; @@ -823,7 +823,7 @@ apic_intr_disestablish(void *arg) apic_vectorset(sc, intr, minlevel, maxlevel); evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } void diff --git a/sys/arch/i386/i386/k1x-pstate.c b/sys/arch/i386/i386/k1x-pstate.c index 25d88d57866..15761d62f32 100644 --- a/sys/arch/i386/i386/k1x-pstate.c +++ b/sys/arch/i386/i386/k1x-pstate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: k1x-pstate.c,v 1.5 2013/10/05 18:47:05 brynet Exp $ */ +/* $OpenBSD: k1x-pstate.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2011 Bryan Steele <brynet@gmail.com> * @@ -200,5 +200,5 @@ k1x_init(struct cpu_info *ci) setperf_prio = 1; return; } - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); } diff --git a/sys/arch/i386/i386/mem.c b/sys/arch/i386/i386/mem.c index 50071b9a624..92acaf355bb 100644 --- a/sys/arch/i386/i386/mem.c +++ b/sys/arch/i386/i386/mem.c @@ -1,5 +1,5 @@ /* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */ -/* $OpenBSD: mem.c,v 1.38 2013/12/19 21:30:02 deraadt Exp $ */ +/* $OpenBSD: mem.c,v 1.39 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 @@ -296,7 +296,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) if (!error) error = copyout(md, mo->mo_desc, nd * sizeof(struct mem_range_desc)); - free(md, M_MEMDESC); + free(md, M_MEMDESC, 0); } else { nd = mem_range_softc.mr_ndesc; } @@ -310,7 +310,7 @@ mem_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) md->mr_owner[sizeof(md->mr_owner) - 1] = 0; if (error == 0) error = mem_range_attr_set(md, &mo->mo_arg[0]); - free(md, M_MEMDESC); + free(md, M_MEMDESC, 0); break; } return (error); diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c index 27553f75516..3a5fac5b7f7 100644 --- a/sys/arch/i386/i386/powernow-k7.c +++ b/sys/arch/i386/i386/powernow-k7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k7.c,v 1.34 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: powernow-k7.c,v 1.35 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -448,5 +448,5 @@ k7_powernow_init(void) setperf_prio = 1; return; } - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); } diff --git a/sys/arch/i386/i386/powernow-k8.c b/sys/arch/i386/i386/powernow-k8.c index 7e74d013cfe..80f6061a5e4 100644 --- a/sys/arch/i386/i386/powernow-k8.c +++ b/sys/arch/i386/i386/powernow-k8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powernow-k8.c,v 1.26 2010/04/20 22:05:41 tedu Exp $ */ +/* $OpenBSD: powernow-k8.c,v 1.27 2014/07/12 18:44:41 tedu Exp $ */ /* * Copyright (c) 2004 Martin Végiard. @@ -512,5 +512,5 @@ k8_powernow_init(void) setperf_prio = 1; return; } - free(cstate, M_DEVBUF); + free(cstate, M_DEVBUF, 0); } diff --git a/sys/arch/i386/i386/softintr.c b/sys/arch/i386/i386/softintr.c index 1c2f9dde53d..778af9ca918 100644 --- a/sys/arch/i386/i386/softintr.c +++ b/sys/arch/i386/i386/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.4 2009/04/19 19:13:57 oga Exp $ */ +/* $OpenBSD: softintr.c,v 1.5 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */ /*- @@ -157,5 +157,5 @@ softintr_disestablish(void *arg) } mtx_leave(&si->softintr_lock); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } diff --git a/sys/arch/i386/i386/sys_machdep.c b/sys/arch/i386/i386/sys_machdep.c index eae9c71c6c6..ef4f33dd64e 100644 --- a/sys/arch/i386/i386/sys_machdep.c +++ b/sys/arch/i386/i386/sys_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_machdep.c,v 1.31 2011/11/07 15:41:33 guenther Exp $ */ +/* $OpenBSD: sys_machdep.c,v 1.32 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: sys_machdep.c,v 1.28 1996/05/03 19:42:29 christos Exp $ */ /*- @@ -126,7 +126,7 @@ i386_get_ldt(struct proc *p, void *args, register_t *retval) if (ua.start > nldt) { simple_unlock(&pmap->pm_lock); - free(cp, M_TEMP); + free(cp, M_TEMP, 0); return (EINVAL); } @@ -147,7 +147,7 @@ i386_get_ldt(struct proc *p, void *args, register_t *retval) if (error == 0) *retval = num; - free(cp, M_TEMP); + free(cp, M_TEMP, 0); return (error); } @@ -319,7 +319,7 @@ copy: *retval = ua.start; out: - free(descv, M_TEMP); + free(descv, M_TEMP, 0); return (error); } #endif /* USER_LDT */ diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c index 86e9bce1019..82d44216281 100644 --- a/sys/arch/i386/i386/via.c +++ b/sys/arch/i386/i386/via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: via.c,v 1.31 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: via.c,v 1.32 2014/07/12 18:44:41 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -120,7 +120,7 @@ viac3_crypto_setup(void) vc3_sc->sc_cid = crypto_get_driverid(0); if (vc3_sc->sc_cid < 0) { - free(vc3_sc, M_DEVBUF); + free(vc3_sc, M_DEVBUF, 0); return; /* YYY bitch? */ } @@ -164,7 +164,7 @@ viac3_crypto_newsession(u_int32_t *sidp, struct cryptoini *cri) return (ENOMEM); bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses)); explicit_bzero(sc->sc_sessions, sesn * sizeof(*ses)); - free(sc->sc_sessions, M_DEVBUF); + free(sc->sc_sessions, M_DEVBUF, 0); sc->sc_sessions = ses; ses = &sc->sc_sessions[sesn]; sc->sc_nsessions++; @@ -304,13 +304,13 @@ viac3_crypto_freesession(u_int64_t tid) if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA); + free(swd->sw_ictx, M_CRYPTO_DATA, 0); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA); + free(swd->sw_octx, M_CRYPTO_DATA, 0); } - free(swd, M_CRYPTO_DATA); + free(swd, M_CRYPTO_DATA, 0); } explicit_bzero(&sc->sc_sessions[sesn], sizeof(sc->sc_sessions[sesn])); @@ -431,7 +431,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd, if (sc->op_buf != NULL) { explicit_bzero(sc->op_buf, crd->crd_len); - free(sc->op_buf, M_DEVBUF); + free(sc->op_buf, M_DEVBUF, 0); sc->op_buf = NULL; } diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 7bf26bb9daa..debed933940 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.c,v 1.75 2013/07/14 18:22:08 kettenis Exp $ */ +/* $OpenBSD: isa_machdep.c,v 1.76 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */ /*- @@ -513,7 +513,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, if (!LEGAL_IRQ(irq) || type == IST_NONE) { printf("%s: isa_intr_establish: bogus irq or type\n", ih_what); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); return (NULL); } switch (intrtype[irq]) { @@ -531,7 +531,7 @@ isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, /*printf("%s: intr_establish: can't share %s with %s, irq %d\n", ih_what, isa_intr_typename(intrtype[irq]), isa_intr_typename(type), irq);*/ - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); return (NULL); } break; @@ -601,7 +601,7 @@ isa_intr_disestablish(isa_chipset_tag_t ic, void *arg) else panic("intr_disestablish: handler not registered"); evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); intr_calculatemasks(); @@ -725,7 +725,7 @@ _isa_bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, out: if (error) { if (map->_dm_cookie != NULL) - free(map->_dm_cookie, M_DEVBUF); + free(map->_dm_cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } return (error); @@ -745,7 +745,7 @@ _isa_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) if (cookie->id_flags & ID_HAS_BOUNCE) _isa_dma_free_bouncebuf(t, map); - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); _bus_dmamap_destroy(t, map); } diff --git a/sys/arch/i386/pci/agp_machdep.c b/sys/arch/i386/pci/agp_machdep.c index 64bb3b1a95c..5af66c3131a 100644 --- a/sys/arch/i386/pci/agp_machdep.c +++ b/sys/arch/i386/pci/agp_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_machdep.c,v 1.17 2014/04/01 09:05:03 mpi Exp $ */ +/* $OpenBSD: agp_machdep.c,v 1.18 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2008 - 2009 Owain G. Ainsworth <oga@openbsd.org> @@ -144,7 +144,7 @@ agp_destroy_map(struct agp_map *map) if (extent_free(ex, map->addr, map->size, EX_NOWAIT | EX_MALLOCOK )) printf("agp_destroy_map: can't free region\n"); - free(map, M_AGP); + free(map, M_AGP, 0); } diff --git a/sys/arch/i386/pci/glxsb.c b/sys/arch/i386/pci/glxsb.c index 2f4225f06a8..d7cf94a622d 100644 --- a/sys/arch/i386/pci/glxsb.c +++ b/sys/arch/i386/pci/glxsb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glxsb.c,v 1.27 2013/10/29 21:44:50 mikeb Exp $ */ +/* $OpenBSD: glxsb.c,v 1.28 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2006 Tom Cosgrove <tom@openbsd.org> @@ -383,7 +383,7 @@ glxsb_crypto_newsession(uint32_t *sidp, struct cryptoini *cri) if (sesn != 0) { bcopy(sc->sc_sessions, ses, sesn * sizeof(*ses)); explicit_bzero(sc->sc_sessions, sesn * sizeof(*ses)); - free(sc->sc_sessions, M_DEVBUF); + free(sc->sc_sessions, M_DEVBUF, 0); } sc->sc_sessions = ses; ses = &sc->sc_sessions[sesn]; @@ -525,22 +525,22 @@ glxsb_crypto_freesession(uint64_t tid) if (swd->sw_kschedule) { explicit_bzero(swd->sw_kschedule, txf->ctxsize); - free(swd->sw_kschedule, M_CRYPTO_DATA); + free(swd->sw_kschedule, M_CRYPTO_DATA, 0); } - free(swd, M_CRYPTO_DATA); + free(swd, M_CRYPTO_DATA, 0); } if ((swd = sc->sc_sessions[sesn].ses_swd_auth)) { axf = swd->sw_axf; if (swd->sw_ictx) { explicit_bzero(swd->sw_ictx, axf->ctxsize); - free(swd->sw_ictx, M_CRYPTO_DATA); + free(swd->sw_ictx, M_CRYPTO_DATA, 0); } if (swd->sw_octx) { explicit_bzero(swd->sw_octx, axf->ctxsize); - free(swd->sw_octx, M_CRYPTO_DATA); + free(swd->sw_octx, M_CRYPTO_DATA, 0); } - free(swd, M_CRYPTO_DATA); + free(swd, M_CRYPTO_DATA, 0); } explicit_bzero(&sc->sc_sessions[sesn], sizeof(sc->sc_sessions[sesn])); return (0); diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index cc3a24f1000..cf0a5f607ea 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.78 2014/04/19 11:53:42 kettenis Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.79 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */ /*- @@ -867,7 +867,7 @@ pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie) idt_vec_free(ih->ih_vec); evcount_detach(&ih->ih_count); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); return; } diff --git a/sys/arch/i386/pci/pcibios.c b/sys/arch/i386/pci/pcibios.c index d76416427fe..ddf28cd2b4d 100644 --- a/sys/arch/i386/pci/pcibios.c +++ b/sys/arch/i386/pci/pcibios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcibios.c,v 1.44 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: pcibios.c,v 1.45 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: pcibios.c,v 1.5 2000/08/01 05:23:59 uch Exp $ */ /* @@ -319,7 +319,7 @@ pcibios_pir_init(struct pcibios_softc *sc) &pcibios_pir_header.exclusive_irq) != PCIBIOS_SUCCESS) { printf("%s: PCI IRQ Routing information unavailable.\n", sc->sc_dev.dv_xname); - free(pcibios_pir_table, M_DEVBUF); + free(pcibios_pir_table, M_DEVBUF, 0); pcibios_pir_table = NULL; pcibios_pir_table_nentries = 0; return NULL; diff --git a/sys/arch/i386/pci/piix.c b/sys/arch/i386/pci/piix.c index f9cde0e2312..206e3891b96 100644 --- a/sys/arch/i386/pci/piix.c +++ b/sys/arch/i386/pci/piix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: piix.c,v 1.9 2008/06/26 05:42:11 ray Exp $ */ +/* $OpenBSD: piix.c,v 1.10 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: piix.c,v 1.1 1999/11/17 01:21:20 thorpej Exp $ */ /*- @@ -113,7 +113,7 @@ piix_init(pci_chipset_tag_t pc, bus_space_tag_t iot, pcitag_t tag, if (bus_space_map(iot, PIIX_REG_ELCR, PIIX_REG_ELCR_SIZE, 0, &ph->ph_elcr_ioh) != 0) { - free(ph, M_DEVBUF); + free(ph, M_DEVBUF, 0); return (1); } diff --git a/sys/arch/i386/pci/rccosb4.c b/sys/arch/i386/pci/rccosb4.c index 160b4772a2a..dc1f0446372 100644 --- a/sys/arch/i386/pci/rccosb4.c +++ b/sys/arch/i386/pci/rccosb4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rccosb4.c,v 1.4 2005/11/23 09:24:57 mickey Exp $ */ +/* $OpenBSD: rccosb4.c,v 1.5 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2004,2005 Michael Shalayeff @@ -79,12 +79,12 @@ osb4_init(pci_chipset_tag_t pc, bus_space_tag_t iot, pcitag_t tag, ph->piix.ph_tag = tag; if (bus_space_map(iot, OSB4_PIAIR, 2, 0, &ph->osb4_ioh)) { - free(ph, M_DEVBUF); + free(ph, M_DEVBUF, 0); return (1); } if (bus_space_map(iot, OSB4_REG_ELCR, 2, 0, &ph->piix.ph_elcr_ioh)) { - free(ph, M_DEVBUF); + free(ph, M_DEVBUF, 0); return (1); } diff --git a/sys/arch/i386/pci/vga_post.c b/sys/arch/i386/pci/vga_post.c index e3d69139328..223de1f7f30 100644 --- a/sys/arch/i386/pci/vga_post.c +++ b/sys/arch/i386/pci/vga_post.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_post.c,v 1.6 2014/04/08 09:02:51 mpi Exp $ */ +/* $OpenBSD: vga_post.c,v 1.7 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */ /*- @@ -142,7 +142,7 @@ vga_post_init(int bus, int device, int function) &sc->ram_backing, BASE_MEMORY/PAGE_SIZE, UVM_PLA_WAITOK); if (err) { uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return NULL; } @@ -213,7 +213,7 @@ vga_post_free(struct vga_post *sc) uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024); pmap_update(pmap_kernel()); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); } #ifdef DDB diff --git a/sys/arch/i386/stand/libsa/diskprobe.c b/sys/arch/i386/stand/libsa/diskprobe.c index 6a50c9298d8..08760fba81f 100644 --- a/sys/arch/i386/stand/libsa/diskprobe.c +++ b/sys/arch/i386/stand/libsa/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.37 2013/11/05 15:17:56 krw Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.38 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -79,7 +79,7 @@ floppyprobe(void) if (debug) printf(" <!fd%u>", i); #endif - free(dip, 0); + free(dip, 0, 0); break; } @@ -122,7 +122,7 @@ hardprobe(void) if (debug) printf(" <!hd%u>", i&0x7f); #endif - free(dip, 0); + free(dip, 0, 0); break; } @@ -234,7 +234,7 @@ cdprobe(void) #if 0 if (bios_getdiskinfo(cddev, &dip->bios_info)) { printf(" <!cd0>"); /* XXX */ - free(dip, 0); + free(dip, 0, 0); return; } #endif diff --git a/sys/arch/i386/stand/libsa/softraid.c b/sys/arch/i386/stand/libsa/softraid.c index 5c7f9b3104e..f887187bf01 100644 --- a/sys/arch/i386/stand/libsa/softraid.c +++ b/sys/arch/i386/stand/libsa/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.6 2013/12/28 02:40:41 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.7 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2012 Joel Sing <jsing@openbsd.org> @@ -315,7 +315,7 @@ srprobe(void) } explicit_bzero(md, SR_META_SIZE * 512); - free(md, 0); + free(md, 0, 0); } int @@ -477,18 +477,18 @@ sr_clear_keys(void) continue; if (bv->sbv_keys != NULL) { explicit_bzero(bv->sbv_keys, SR_CRYPTO_KEYBLOCK_BYTES); - free(bv->sbv_keys, 0); + free(bv->sbv_keys, 0, 0); bv->sbv_keys = NULL; } if (bv->sbv_maskkey != NULL) { explicit_bzero(bv->sbv_maskkey, SR_CRYPTO_MAXKEYBYTES); - free(bv->sbv_maskkey, 0); + free(bv->sbv_maskkey, 0, 0); bv->sbv_maskkey = NULL; } } SLIST_FOREACH(kd, &sr_keydisks, kd_link) { explicit_bzero(kd, sizeof(*kd)); - free(kd, 0); + free(kd, 0, 0); } } @@ -618,7 +618,7 @@ done: if (keys != NULL && rv != 0) { explicit_bzero(keys, SR_CRYPTO_KEYBLOCK_BYTES); - free(keys, 0); + free(keys, 0, 0); } return (rv); diff --git a/sys/arch/landisk/landisk/bus_dma.c b/sys/arch/landisk/landisk/bus_dma.c index fe4c516a500..172a2fc40b2 100644 --- a/sys/arch/landisk/landisk/bus_dma.c +++ b/sys/arch/landisk/landisk/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.10 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.11 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ /* @@ -126,7 +126,7 @@ _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) DPRINTF(("bus_dmamap_destroy: t = %p, map = %p\n", t, map)); - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } static inline int diff --git a/sys/arch/landisk/landisk/intr.c b/sys/arch/landisk/landisk/intr.c index 7e73e7c3c2f..5c2d34e46c5 100644 --- a/sys/arch/landisk/landisk/intr.c +++ b/sys/arch/landisk/landisk/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.8 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: intr.c,v 1.9 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: intr.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ /*- @@ -237,7 +237,7 @@ extintr_disestablish(void *aux) evcount_detach(&ih->ih_count); #endif - free((void *)ih, M_DEVBUF); + free((void *)ih, M_DEVBUF, 0); if (--eih->eih_nih == 0) { intc_intr_disestablish(eih->eih_func); diff --git a/sys/arch/loongson/dev/bonito.c b/sys/arch/loongson/dev/bonito.c index 08793435314..b4b390b33dd 100644 --- a/sys/arch/loongson/dev/bonito.c +++ b/sys/arch/loongson/dev/bonito.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bonito.c,v 1.26 2014/05/24 21:11:01 miod Exp $ */ +/* $OpenBSD: bonito.c,v 1.27 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */ /* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */ @@ -468,7 +468,7 @@ bonito_intr_disestablish(void *vih) splx(s); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } /* @@ -1204,7 +1204,7 @@ bonito_get_resource_extent(pci_chipset_tag_t pc, int io) out: if (exname != NULL) - free(exname, M_DEVBUF); + free(exname, M_DEVBUF, 0); return ex; } diff --git a/sys/arch/loongson/loongson/bus_dma.c b/sys/arch/loongson/loongson/bus_dma.c index f547becd9c3..e497a9d7dd6 100644 --- a/sys/arch/loongson/loongson/bus_dma.c +++ b/sys/arch/loongson/loongson/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.14 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.15 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -117,7 +117,7 @@ _dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/loongson/stand/boot/dev.c b/sys/arch/loongson/stand/boot/dev.c index d112228de84..1d92808e753 100644 --- a/sys/arch/loongson/stand/boot/dev.c +++ b/sys/arch/loongson/stand/boot/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.5 2013/06/11 16:42:09 deraadt Exp $ */ +/* $OpenBSD: dev.c,v 1.6 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -160,7 +160,7 @@ pmon_ioclose(struct open_file *f) if (f->f_devdata != NULL) { pi = (struct pmon_iodata *)f->f_devdata; rc = pmon_close(pi->fd); - free(pi, sizeof *pi); + free(pi, sizeof *pi, 0); f->f_devdata = NULL; } else rc = 0; diff --git a/sys/arch/luna88k/stand/boot/sd.c b/sys/arch/luna88k/stand/boot/sd.c index 1656638ae66..097188e7306 100644 --- a/sys/arch/luna88k/stand/boot/sd.c +++ b/sys/arch/luna88k/stand/boot/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.3 2013/10/29 21:49:07 miod Exp $ */ +/* $OpenBSD: sd.c,v 1.4 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: sd.c,v 1.5 2013/01/22 15:48:40 tsutsui Exp $ */ /* @@ -281,7 +281,7 @@ sdclose(struct open_file *f) { struct sd_softc *sc = f->f_devdata; - free(sc, sizeof *sc); + free(sc, sizeof *sc, 0); f->f_devdata = NULL; return 0; diff --git a/sys/arch/m88k/m88k/softintr.c b/sys/arch/m88k/m88k/softintr.c index 0ba6e61916f..c8e6ba3abb1 100644 --- a/sys/arch/m88k/m88k/softintr.c +++ b/sys/arch/m88k/m88k/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.3 2014/07/08 17:42:50 miod Exp $ */ +/* $OpenBSD: softintr.c,v 1.4 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -147,7 +147,7 @@ softintr_disestablish(void *arg) } mtx_leave(&siq->siq_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c index cb8e625033c..17b63e6e691 100644 --- a/sys/arch/macppc/dev/awacs.c +++ b/sys/arch/macppc/dev/awacs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: awacs.c,v 1.28 2013/05/15 08:29:23 ratchov Exp $ */ +/* $OpenBSD: awacs.c,v 1.29 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: awacs.c,v 1.4 2001/02/26 21:07:51 wiz Exp $ */ /*- @@ -975,7 +975,7 @@ awacs_allocm(void *h, int dir, size_t size, int type, int flags) 1, &p->nsegs, flags)) != 0) { printf("%s: unable to allocate dma, error = %d\n", sc->sc_dev.dv_xname, error); - free(p, type); + free(p, type, 0); return NULL; } @@ -984,7 +984,7 @@ awacs_allocm(void *h, int dir, size_t size, int type, int flags) printf("%s: unable to map dma, error = %d\n", sc->sc_dev.dv_xname, error); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } @@ -994,7 +994,7 @@ awacs_allocm(void *h, int dir, size_t size, int type, int flags) sc->sc_dev.dv_xname, error); bus_dmamem_unmap(sc->sc_dmat, p->addr, size); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } @@ -1005,7 +1005,7 @@ awacs_allocm(void *h, int dir, size_t size, int type, int flags) bus_dmamap_destroy(sc->sc_dmat, p->map); bus_dmamem_unmap(sc->sc_dmat, p->addr, size); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } diff --git a/sys/arch/macppc/dev/dbdma.c b/sys/arch/macppc/dev/dbdma.c index 904d4049a58..e47b2d0bbb7 100644 --- a/sys/arch/macppc/dev/dbdma.c +++ b/sys/arch/macppc/dev/dbdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dbdma.c,v 1.9 2007/09/17 01:33:33 krw Exp $ */ +/* $OpenBSD: dbdma.c,v 1.10 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: dbdma.c,v 1.2 1998/08/21 16:13:28 tsubai Exp $ */ /* @@ -153,5 +153,5 @@ dbdma_free(dbdma_t dt) bus_dmamem_unmap(dt->d_dmat, (caddr_t)dt->d_addr, dt->d_size); if (dt->d_nsegs) bus_dmamem_free(dt->d_dmat, dt->d_segs, dt->d_nsegs); - free(dt, M_DEVBUF); + free(dt, M_DEVBUF, 0); } diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c index 5f21a986a1c..59442042879 100644 --- a/sys/arch/macppc/dev/i2s.c +++ b/sys/arch/macppc/dev/i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2s.c,v 1.23 2013/05/15 08:29:23 ratchov Exp $ */ +/* $OpenBSD: i2s.c,v 1.24 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -1177,7 +1177,7 @@ i2s_allocm(void *h, int dir, size_t size, int type, int flags) 1, &p->nsegs, flags)) != 0) { printf("%s: unable to allocate dma, error = %d\n", sc->sc_dev.dv_xname, error); - free(p, type); + free(p, type, 0); return NULL; } @@ -1186,7 +1186,7 @@ i2s_allocm(void *h, int dir, size_t size, int type, int flags) printf("%s: unable to map dma, error = %d\n", sc->sc_dev.dv_xname, error); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } @@ -1196,7 +1196,7 @@ i2s_allocm(void *h, int dir, size_t size, int type, int flags) sc->sc_dev.dv_xname, error); bus_dmamem_unmap(sc->sc_dmat, p->addr, size); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } @@ -1207,7 +1207,7 @@ i2s_allocm(void *h, int dir, size_t size, int type, int flags) bus_dmamap_destroy(sc->sc_dmat, p->map); bus_dmamem_unmap(sc->sc_dmat, p->addr, size); bus_dmamem_free(sc->sc_dmat, p->segs, p->nsegs); - free(p, type); + free(p, type, 0); return NULL; } diff --git a/sys/arch/macppc/dev/macintr.c b/sys/arch/macppc/dev/macintr.c index 1e8b3048aa9..8e716c235c3 100644 --- a/sys/arch/macppc/dev/macintr.c +++ b/sys/arch/macppc/dev/macintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: macintr.c,v 1.46 2014/04/01 20:27:14 mpi Exp $ */ +/* $OpenBSD: macintr.c,v 1.47 2014/07/12 18:44:42 tedu Exp $ */ /*- * Copyright (c) 2008 Dale Rahn <drahn@openbsd.org> @@ -361,7 +361,7 @@ macintr_disestablish(void *lcp, void *arg) ppc_intr_enable(s); evcount_detach(&ih->ih_count); - free((void *)ih, M_DEVBUF); + free((void *)ih, M_DEVBUF, 0); if (TAILQ_EMPTY(&iq->iq_list)) iq->iq_ist = IST_NONE; diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c index e2a4b01ae92..7167c801a53 100644 --- a/sys/arch/macppc/dev/openpic.c +++ b/sys/arch/macppc/dev/openpic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openpic.c,v 1.71 2014/04/01 20:27:14 mpi Exp $ */ +/* $OpenBSD: openpic.c,v 1.72 2014/07/12 18:44:42 tedu Exp $ */ /*- * Copyright (c) 2008 Dale Rahn <drahn@openbsd.org> @@ -379,7 +379,7 @@ openpic_intr_disestablish(void *lcp, void *arg) ppc_intr_enable(s); evcount_detach(&ih->ih_count); - free((void *)ih, M_DEVBUF); + free((void *)ih, M_DEVBUF, 0); if (TAILQ_EMPTY(&iq->iq_list)) iq->iq_ist = IST_NONE; diff --git a/sys/arch/macppc/macppc/dma.c b/sys/arch/macppc/macppc/dma.c index 07860292f2b..0c61b43fcec 100644 --- a/sys/arch/macppc/macppc/dma.c +++ b/sys/arch/macppc/macppc/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.39 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: dma.c,v 1.40 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -103,7 +103,7 @@ void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } diff --git a/sys/arch/macppc/macppc/mainbus.c b/sys/arch/macppc/macppc/mainbus.c index f6441e8ad3e..1494ae0f062 100644 --- a/sys/arch/macppc/macppc/mainbus.c +++ b/sys/arch/macppc/macppc/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.22 2014/07/02 15:34:43 tobiasu Exp $ */ +/* $OpenBSD: mainbus.c,v 1.23 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -90,7 +90,7 @@ mbattach(struct device *parent, struct device *self, void *aux) slen = strlen(t) + strlen(name) - 3; if ((hw_prod = malloc(slen, M_DEVBUF, M_NOWAIT)) != NULL) { snprintf(hw_prod, slen, "%s %s", t, name + 5); - free(t, M_DEVBUF); + free(t, M_DEVBUF, 0); } } else { /* New World Macintosh or Unknown */ diff --git a/sys/arch/macppc/macppc/mem.c b/sys/arch/macppc/macppc/mem.c index 6d1d68a0784..f9a80edba21 100644 --- a/sys/arch/macppc/macppc/mem.c +++ b/sys/arch/macppc/macppc/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.17 2011/11/10 17:30:32 krw Exp $ */ +/* $OpenBSD: mem.c,v 1.18 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -152,7 +152,7 @@ mem_attach(struct device *parent, struct device *self, void *aux) } /* No need to keep the "dimm-info" contents around. */ - free(sc->sc_buf, M_DEVBUF); + free(sc->sc_buf, M_DEVBUF, 0); sc->sc_len = -1; } } diff --git a/sys/arch/macppc/macppc/openprom.c b/sys/arch/macppc/macppc/openprom.c index 01918683e85..e661733e39c 100644 --- a/sys/arch/macppc/macppc/openprom.c +++ b/sys/arch/macppc/macppc/openprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openprom.c,v 1.2 2011/06/17 07:06:46 mk Exp $ */ +/* $OpenBSD: openprom.c,v 1.3 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */ /* @@ -256,9 +256,9 @@ openpromioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p) } if (name) - free(name, M_TEMP); + free(name, M_TEMP, 0); if (value) - free(value, M_TEMP); + free(value, M_TEMP, 0); return (error); } diff --git a/sys/arch/mips64/mips64/softintr.c b/sys/arch/mips64/mips64/softintr.c index 414b95d6a71..fc0e9ec97e7 100644 --- a/sys/arch/mips64/mips64/softintr.c +++ b/sys/arch/mips64/mips64/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.16 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: softintr.c,v 1.17 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -153,7 +153,7 @@ softintr_disestablish(void *arg) } mtx_leave(&siq->siq_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* diff --git a/sys/arch/octeon/dev/octcf.c b/sys/arch/octeon/dev/octcf.c index 02646c483fa..4f7b75ed621 100644 --- a/sys/arch/octeon/dev/octcf.c +++ b/sys/arch/octeon/dev/octcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octcf.c,v 1.14 2014/05/10 22:25:16 jasper Exp $ */ +/* $OpenBSD: octcf.c,v 1.15 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -599,7 +599,7 @@ octcfioctl(dev_t dev, u_long xfer, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); octcfgetdisklabel(dev, wd, lp, 0); bcopy(lp, wd->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); goto exit; case DIOCGPDINFO: @@ -851,7 +851,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *prms) if (error != 0) { printf("%s: identify failed: %d\n", __func__, error); - free(tb, M_DEVBUF); + free(tb, M_DEVBUF, 0); return CMD_ERR; } else { #if BYTE_ORDER == BIG_ENDIAN @@ -882,7 +882,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *prms) prms->atap_model[1] == 'E') || (prms->atap_model[0] == 'F' && prms->atap_model[1] == 'X'))) { - free(tb, M_DEVBUF); + free(tb, M_DEVBUF, 0); return CMD_OK; } for (i = 0; i < sizeof(prms->atap_model); i += 2) { @@ -898,7 +898,7 @@ octcf_get_params(struct octcf_softc *wd, struct ataparams *prms) *p = swap16(*p); } - free(tb, M_DEVBUF); + free(tb, M_DEVBUF, 0); return CMD_OK; } } diff --git a/sys/arch/octeon/dev/octeon_pcibus.c b/sys/arch/octeon/dev/octeon_pcibus.c index 1fe8f1051b8..1ca37cb1651 100644 --- a/sys/arch/octeon/dev/octeon_pcibus.c +++ b/sys/arch/octeon/dev/octeon_pcibus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octeon_pcibus.c,v 1.14 2014/05/11 09:23:49 jasper Exp $ */ +/* $OpenBSD: octeon_pcibus.c,v 1.15 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: bonito_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */ /* $NetBSD: bonito_pci.c,v 1.5 2008/04/28 20:23:28 martin Exp $ */ @@ -504,7 +504,7 @@ octeon_pcibus_get_resource_extent(pci_chipset_tag_t pc, int io) out: if (exname != NULL) - free(exname, M_DEVBUF); + free(exname, M_DEVBUF, 0); return ex; } diff --git a/sys/arch/octeon/octeon/bus_dma.c b/sys/arch/octeon/octeon/bus_dma.c index d8fdd75c82b..c5de3063c8b 100644 --- a/sys/arch/octeon/octeon/bus_dma.c +++ b/sys/arch/octeon/octeon/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.11 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.12 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -117,7 +117,7 @@ _dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/powerpc/powerpc/softintr.c b/sys/arch/powerpc/powerpc/softintr.c index 1880d4672a6..f018a1b120a 100644 --- a/sys/arch/powerpc/powerpc/softintr.c +++ b/sys/arch/powerpc/powerpc/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.5 2014/07/03 07:02:10 matthieu Exp $ */ +/* $OpenBSD: softintr.c,v 1.6 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -154,7 +154,7 @@ softintr_disestablish(void *arg) } mtx_leave(&siq->siq_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* diff --git a/sys/arch/sgi/dev/impact.c b/sys/arch/sgi/dev/impact.c index 58b0ffb73bf..633f85888d8 100644 --- a/sys/arch/sgi/dev/impact.c +++ b/sys/arch/sgi/dev/impact.c @@ -1,4 +1,4 @@ -/* $OpenBSD: impact.c,v 1.5 2013/10/21 10:36:16 miod Exp $ */ +/* $OpenBSD: impact.c,v 1.6 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2010, 2012 Miodrag Vallat. @@ -168,7 +168,7 @@ impact_attach_common(struct impact_softc *sc, bus_space_tag_t iot, impact_setup(scr, has_hq4); if (impact_init_screen(scr) != 0) { printf("failed to allocate memory\n"); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return ENOMEM; } } diff --git a/sys/arch/sgi/dev/spdmem_mainbus.c b/sys/arch/sgi/dev/spdmem_mainbus.c index 079e24a3cfb..8b6de372241 100644 --- a/sys/arch/sgi/dev/spdmem_mainbus.c +++ b/sys/arch/sgi/dev/spdmem_mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spdmem_mainbus.c,v 1.1 2010/03/22 21:22:08 miod Exp $ */ +/* $OpenBSD: spdmem_mainbus.c,v 1.2 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2010 Miodrag Vallat. @@ -66,7 +66,7 @@ spdmem_mainbus_match(struct device *parent, void *vcf, void *aux) rc = l1_get_brick_spd_record(saa->maa.maa_nasid, saa->dimm, &spd, &spdlen); if (rc == 0) { - free(spd, M_DEVBUF); + free(spd, M_DEVBUF, 0); return 1; } else return 0; @@ -92,7 +92,7 @@ spdmem_mainbus_attach(struct device *parent, struct device *self, void *aux) spdmem_attach_common(&sc->sc_base); /* free record, as it won't be accessed anymore */ sc->sc_spdlen = 0; - free(sc->sc_spd, M_DEVBUF); + free(sc->sc_spd, M_DEVBUF, 0); } uint8_t diff --git a/sys/arch/sgi/gio/grtwo.c b/sys/arch/sgi/gio/grtwo.c index a11c58c0730..4727dd1f6af 100644 --- a/sys/arch/sgi/gio/grtwo.c +++ b/sys/arch/sgi/gio/grtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grtwo.c,v 1.9 2014/03/29 13:01:31 miod Exp $ */ +/* $OpenBSD: grtwo.c,v 1.10 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: grtwo.c,v 1.11 2009/11/22 19:09:15 mbalmer Exp $ */ /* @@ -411,11 +411,11 @@ grtwo_attach(struct device *parent, struct device *self, void *aux) goto out; if (grtwo_attach_common(dc, ga) != 0) { printf("\n%s: not responding\n", self->dv_xname); - free(dc, M_DEVBUF); + free(dc, M_DEVBUF, 0); return; } if (grtwo_init_screen(dc, M_WAITOK | M_CANFAIL) != 0) { - free(dc, M_DEVBUF); + free(dc, M_DEVBUF, 0); goto out; } #endif diff --git a/sys/arch/sgi/gio/newport.c b/sys/arch/sgi/gio/newport.c index ec39ce09223..4e9b5504f3a 100644 --- a/sys/arch/sgi/gio/newport.c +++ b/sys/arch/sgi/gio/newport.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newport.c,v 1.8 2013/10/21 10:36:17 miod Exp $ */ +/* $OpenBSD: newport.c,v 1.9 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: newport.c,v 1.15 2009/05/12 23:51:25 macallan Exp $ */ /* @@ -554,7 +554,7 @@ newport_attach(struct device *parent, struct device *self, void *aux) if (fail) { printf("%s: failed to initialize screen\n", self->dv_xname); - free(dc, M_DEVBUF); + free(dc, M_DEVBUF, 0); return; } diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c index 915d529ddf7..a6cf5ed7c62 100644 --- a/sys/arch/sgi/sgi/bus_dma.c +++ b/sys/arch/sgi/sgi/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.35 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.36 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -120,7 +120,7 @@ _dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/sgi/sgi/eisa_machdep.c b/sys/arch/sgi/sgi/eisa_machdep.c index 4da23e87680..01ede04030d 100644 --- a/sys/arch/sgi/sgi/eisa_machdep.c +++ b/sys/arch/sgi/sgi/eisa_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eisa_machdep.c,v 1.2 2012/04/15 20:44:52 miod Exp $ */ +/* $OpenBSD: eisa_machdep.c,v 1.3 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2012 Miodrag Vallat. @@ -183,7 +183,7 @@ eisa_intr_disestablish(eisa_chipset_tag_t ec, void *cookie) } evcount_detach(&eih->ei_evcnt); - free(eih, M_DEVBUF); + free(eih, M_DEVBUF, 0); } int diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index a35ded7e2ff..4e4a5da76d2 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.60 2014/07/12 14:12:44 uebayasi Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.61 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -784,7 +784,7 @@ ip27_hub_intr_disestablish(int intrbit) splx(s); if (ISSET(ih->ih_flags, IH_ALLOCATED)) - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } void diff --git a/sys/arch/sgi/sgi/l1.c b/sys/arch/sgi/sgi/l1.c index 71bd0ac5937..79749bebf89 100644 --- a/sys/arch/sgi/sgi/l1.c +++ b/sys/arch/sgi/sgi/l1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l1.c,v 1.7 2011/03/12 23:43:19 miod Exp $ */ +/* $OpenBSD: l1.c,v 1.8 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. @@ -771,7 +771,7 @@ l1_read_board_ia(int16_t nasid, int type, u_char **ria, size_t *rialen) fail: if (ia != NULL) - free(ia, M_DEVBUF); + free(ia, M_DEVBUF, 0); return rc; } @@ -914,7 +914,7 @@ l1_get_brick_ethernet_address(int16_t nasid, uint8_t *enaddr) enaddr_aton(hexaddr, enaddr); out: - free(ia, M_DEVBUF); + free(ia, M_DEVBUF, 0); return rc; } @@ -1188,6 +1188,6 @@ l1_get_brick_spd_record(int16_t nasid, int dimm, u_char **rspd, size_t *rspdlen) fail: if (spd != NULL) - free(spd, M_DEVBUF); + free(spd, M_DEVBUF, 0); return rc; } diff --git a/sys/arch/sgi/stand/boot/diskio.c b/sys/arch/sgi/stand/boot/diskio.c index 5768439a799..63b76cc35ea 100644 --- a/sys/arch/sgi/stand/boot/diskio.c +++ b/sys/arch/sgi/stand/boot/diskio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskio.c,v 1.7 2012/03/19 17:38:31 miod Exp $ */ +/* $OpenBSD: diskio.c,v 1.8 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2000 Opsycon AB (www.opsycon.se) @@ -125,7 +125,7 @@ int dioclose(struct open_file *f) { Bios_Close(((struct dio_softc *)f->f_devdata)->sc_fd); - free(f->f_devdata, sizeof(struct dio_softc)); + free(f->f_devdata, sizeof(struct dio_softc), 0); f->f_devdata = NULL; return (0); } diff --git a/sys/arch/sgi/stand/sgivol/sgivol.c b/sys/arch/sgi/stand/sgivol/sgivol.c index 5fa2e18b401..fa054a3c324 100644 --- a/sys/arch/sgi/stand/sgivol/sgivol.c +++ b/sys/arch/sgi/stand/sgivol/sgivol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sgivol.c,v 1.21 2013/11/13 07:16:18 deraadt Exp $ */ +/* $OpenBSD: sgivol.c,v 1.22 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: sgivol.c,v 1.8 2003/11/08 04:59:00 sekiya Exp $ */ /*- @@ -432,7 +432,7 @@ write_file(void) i -= fsize; } fclose(fp); - free(fbuf); + free(fbuf, 0); } void diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index a662b600e56..b55e28daffa 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.89 2014/05/19 21:18:42 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.90 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2008, 2009, 2011 Miodrag Vallat. @@ -641,16 +641,16 @@ xbpci_attach(struct device *parent, struct device *self, void *aux) return; fail2: - free(xb->xb_dmat, M_DEVBUF); + free(xb->xb_dmat, M_DEVBUF, 0); fail1: if (xb->xb_io_bus_space_sw != NULL) - free(xb->xb_io_bus_space_sw, M_DEVBUF); + free(xb->xb_io_bus_space_sw, M_DEVBUF, 0); if (xb->xb_io_bus_space != NULL) - free(xb->xb_io_bus_space, M_DEVBUF); + free(xb->xb_io_bus_space, M_DEVBUF, 0); if (xb->xb_mem_bus_space_sw != NULL) - free(xb->xb_mem_bus_space_sw, M_DEVBUF); + free(xb->xb_mem_bus_space_sw, M_DEVBUF, 0); if (xb->xb_mem_bus_space != NULL) - free(xb->xb_mem_bus_space, M_DEVBUF); + free(xb->xb_mem_bus_space, M_DEVBUF, 0); if (errmsg == NULL) errmsg = "not enough memory to build bus access structures"; printf("%s\n", errmsg); @@ -1090,7 +1090,7 @@ xbridge_intr_establish(void *cookie, pci_intr_handle_t ih, int level, LIST_INIT(&xi->xi_handlers); if (xbow_intr_register(xb->xb_widget, level, &intrsrc) != 0) { - free(xi, M_DEVBUF); + free(xi, M_DEVBUF, 0); return NULL; } @@ -1198,7 +1198,7 @@ xbridge_intr_disestablish(void *cookie, void *vih) */ } - free(xih, M_DEVBUF); + free(xih, M_DEVBUF, 0); } int diff --git a/sys/arch/sgi/xbow/xheart.c b/sys/arch/sgi/xbow/xheart.c index 65caa7ef1e2..75d18ebcd27 100644 --- a/sys/arch/sgi/xbow/xheart.c +++ b/sys/arch/sgi/xbow/xheart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xheart.c,v 1.25 2012/10/03 11:18:23 miod Exp $ */ +/* $OpenBSD: xheart.c,v 1.26 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -374,7 +374,7 @@ xheart_intr_disestablish(int intrbit) splx(s); if (ISSET(ih->ih_flags, IH_ALLOCATED)) - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } void diff --git a/sys/arch/sh/sh/interrupt.c b/sys/arch/sh/sh/interrupt.c index d2d6f7b247d..47274455cc9 100644 --- a/sys/arch/sh/sh/interrupt.c +++ b/sys/arch/sh/sh/interrupt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interrupt.c,v 1.13 2012/09/08 22:01:25 miod Exp $ */ +/* $OpenBSD: interrupt.c,v 1.14 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: interrupt.c,v 1.18 2006/01/25 00:02:57 uwe Exp $ */ /*- @@ -654,7 +654,7 @@ softintr_disestablish(void *arg) } mtx_leave(&asi->softintr_lock); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* Schedule a software interrupt. */ diff --git a/sys/arch/socppc/dev/if_tsec.c b/sys/arch/socppc/dev/if_tsec.c index 2f3cb628d34..b9053b73c2e 100644 --- a/sys/arch/socppc/dev/if_tsec.c +++ b/sys/arch/socppc/dev/if_tsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tsec.c,v 1.30 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_tsec.c,v 1.31 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 2008 Mark Kettenis @@ -1077,7 +1077,7 @@ tsec_down(struct tsec_softc *sc) } tsec_dmamem_free(sc, sc->sc_rxring); - free(sc->sc_rxbuf, M_DEVBUF); + free(sc->sc_rxbuf, M_DEVBUF, 0); } void @@ -1258,7 +1258,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, tdm->tdm_map); tdmfree: - free(tdm, M_DEVBUF); + free(tdm, M_DEVBUF, 0); return (NULL); } @@ -1269,7 +1269,7 @@ tsec_dmamem_free(struct tsec_softc *sc, struct tsec_dmamem *tdm) bus_dmamem_unmap(sc->sc_dmat, tdm->tdm_kva, tdm->tdm_size); bus_dmamem_free(sc->sc_dmat, &tdm->tdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, tdm->tdm_map); - free(tdm, M_DEVBUF); + free(tdm, M_DEVBUF, 0); } struct mbuf * diff --git a/sys/arch/socppc/socppc/dma.c b/sys/arch/socppc/socppc/dma.c index 5bb208fa451..b19139179b1 100644 --- a/sys/arch/socppc/socppc/dma.c +++ b/sys/arch/socppc/socppc/dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.c,v 1.11 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: dma.c,v 1.12 2014/07/12 18:44:42 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -103,7 +103,7 @@ void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c index 1527085847a..893768e4541 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.38 2014/07/11 22:28:05 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.39 2014/07/12 18:44:42 tedu Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -254,7 +254,7 @@ setregs(p, pack, stack, retval) savefpstate(fs); cpuinfo.fpproc = NULL; } - free((void *)fs, M_SUBPROC); + free((void *)fs, M_SUBPROC, 0); p->p_md.md_fpstate = NULL; } bzero((caddr_t)tf, sizeof *tf); diff --git a/sys/arch/sparc/dev/cs4231.c b/sys/arch/sparc/dev/cs4231.c index 046e626684a..0f5ab7d281a 100644 --- a/sys/arch/sparc/dev/cs4231.c +++ b/sys/arch/sparc/dev/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.31 2013/05/15 21:19:45 ratchov Exp $ */ +/* $OpenBSD: cs4231.c,v 1.32 2014/07/12 18:44:42 tedu Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -1461,7 +1461,7 @@ cs4231_alloc(addr, direction, size, pool, flags) p->addr_dva = dvma_malloc(size, &p->addr, flags); if (p->addr_dva == NULL) { - free(p, pool); + free(p, pool, 0); return (NULL); } @@ -1485,7 +1485,7 @@ cs4231_free(addr, ptr, pool) continue; dvma_free(p->addr_dva, p->size, &p->addr); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } printf("%s: attempt to free rogue pointer\n", sc->sc_dev.dv_xname); diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 2112db9059b..f47931cb127 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.89 2013/11/26 15:42:43 martin Exp $ */ +/* $OpenBSD: fd.c,v 1.90 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -1766,7 +1766,7 @@ fdioctl(dev, cmd, addr, flag, p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); fdgetdisklabel(dev, fd, lp, 0); bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); return 0; case DIOCGPDINFO: @@ -1938,7 +1938,7 @@ fdformat(dev, finfo, p) /* ...and wait for it to complete */ rv = biowait(bp); - free(bp, M_TEMP); + free(bp, M_TEMP, 0); return (rv); } diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c index 50be93a3f9b..dd09f1b8a0e 100644 --- a/sys/arch/sparc/dev/magma.c +++ b/sys/arch/sparc/dev/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.27 2010/07/02 17:27:01 nicm Exp $ */ +/* $OpenBSD: magma.c,v 1.28 2014/07/12 18:44:43 tedu Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -1754,7 +1754,7 @@ again: /* goto bad */ uio->uio_resid += (len - cnt); } - free(buffer, M_DEVBUF); + free(buffer, M_DEVBUF, 0); return (error); } diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 4ba613d5750..5a6b80a7c0d 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.94 2014/05/09 20:15:06 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.95 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -1039,7 +1039,7 @@ romprop(rp, cp, node) rp->ra_intr[n].int_vec = 0; }; len *= sizeof(struct rom_intr); - free(interrupts, M_TEMP); + free(interrupts, M_TEMP, 0); } else len = 0; } diff --git a/sys/arch/sparc/sparc/clock.c b/sys/arch/sparc/sparc/clock.c index bf596958c5a..befc549d698 100644 --- a/sys/arch/sparc/sparc/clock.c +++ b/sys/arch/sparc/sparc/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.28 2013/07/05 20:30:56 guenther Exp $ */ +/* $OpenBSD: clock.c,v 1.29 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: clock.c,v 1.52 1997/05/24 20:16:05 pk Exp $ */ /* @@ -1126,7 +1126,7 @@ eeprom_uio(uio) out: if (buf) - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); eeprom_give(); return (error); #else /* ! SUN4 */ diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c index 934b3db70dc..d06cdc9d71b 100644 --- a/sys/arch/sparc/sparc/intr.c +++ b/sys/arch/sparc/sparc/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.38 2012/11/05 13:20:16 miod Exp $ */ +/* $OpenBSD: intr.c,v 1.39 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: intr.c,v 1.20 1997/07/29 09:42:03 fair Exp $ */ /* @@ -416,7 +416,7 @@ softintr_disestablish(void *arg) struct sintrhand *sih = (struct sintrhand *)arg; ih_remove(&sintrhand[sih->sih_ipl], &sih->sih_ih); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } void * diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 25df437a34b..75103fc5206 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.160 2014/07/11 22:28:06 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.161 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -264,7 +264,7 @@ setregs(p, pack, stack, retval) savefpstate(fs); cpuinfo.fpproc = NULL; } - free((void *)fs, M_SUBPROC); + free((void *)fs, M_SUBPROC, 0); p->p_md.md_fpstate = NULL; } bzero((caddr_t)tf, sizeof *tf); @@ -969,7 +969,7 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void _bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* @@ -1083,7 +1083,7 @@ _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs) * Return the list of pages back to the VM system. */ uvm_pglistfree(segs[0]._ds_mlist); - free(segs[0]._ds_mlist, M_DEVBUF); + free(segs[0]._ds_mlist, M_DEVBUF, 0); } /* diff --git a/sys/arch/sparc/sparc/openprom.c b/sys/arch/sparc/sparc/openprom.c index 1aa16d4ce30..7f55c20303d 100644 --- a/sys/arch/sparc/sparc/openprom.c +++ b/sys/arch/sparc/sparc/openprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openprom.c,v 1.5 2003/06/02 23:27:55 millert Exp $ */ +/* $OpenBSD: openprom.c,v 1.6 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: openprom.c,v 1.8 1996/03/31 23:45:34 pk Exp $ */ /* @@ -246,9 +246,9 @@ openpromioctl(dev, cmd, data, flags, p) } if (name) - free(name, M_TEMP); + free(name, M_TEMP, 0); if (value) - free(value, M_TEMP); + free(value, M_TEMP, 0); return (error); } diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c index 9e3a5eba96c..9d35e0a6fae 100644 --- a/sys/arch/sparc/sparc/pmap.c +++ b/sys/arch/sparc/sparc/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.164 2014/04/08 13:23:51 mpi Exp $ */ +/* $OpenBSD: pmap.c,v 1.165 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */ /* @@ -3633,7 +3633,7 @@ pmap_destroy(pm) simple_unlock(&pm->pm_lock); if (count == 0) { pmap_release(pm); - free(pm, M_VMPMAP); + free(pm, M_VMPMAP, 0); } } @@ -3695,7 +3695,7 @@ if (pmapdebug) { } #endif if (pm->pm_regstore) - free(pm->pm_regstore, M_VMPMAP); + free(pm->pm_regstore, M_VMPMAP, 0); #if defined(SUN4M) if (CPU_ISSUN4M) { @@ -4091,10 +4091,10 @@ pmap_rmu4_4c(pm, va, endva, vr, vs) pm->pm_stats.resident_count--; } if ((sp->sg_npte = nleft) == 0) { - free(pte0, M_VMPMAP); + free(pte0, M_VMPMAP, 0); sp->sg_pte = NULL; if (--rp->rg_nsegmap == 0) { - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; #if defined(SUN4_MMU3L) if (HASSUN4_MMU3L && rp->rg_smeg != reginval) { @@ -4175,12 +4175,12 @@ if (pm->pm_ctx == NULL) { setregmap(0, rp->rg_smeg); setsegmap(vs << SGSHIFT, seginval); } - free(pte0, M_VMPMAP); + free(pte0, M_VMPMAP, 0); sp->sg_pte = NULL; me_free(pm, pmeg); if (--rp->rg_nsegmap == 0) { - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; GAP_WIDEN(pm,vr); @@ -4301,7 +4301,7 @@ pmap_rmu4m(pm, va, endva, vr, vs) if (pm->pm_ctx) tlb_flush_context(); /* Paranoia? */ setpgt4m(&pm->pm_reg_ptps[vr], SRMMU_TEINVALID); - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; pool_put(&L23_pool, rp->rg_seg_ptps); } @@ -4382,10 +4382,10 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot) if (nleft) { sp->sg_pte[VA_VPG(va)] = 0; } else { - free(sp->sg_pte, M_VMPMAP); + free(sp->sg_pte, M_VMPMAP, 0); sp->sg_pte = NULL; if (--rp->rg_nsegmap == 0) { - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; GAP_WIDEN(pm,vr); #if defined(SUN4_MMU3L) @@ -4464,7 +4464,7 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot) setsegmap(vs << SGSHIFT, seginval); } #endif - free(sp->sg_pte, M_VMPMAP); + free(sp->sg_pte, M_VMPMAP, 0); sp->sg_pte = NULL; me_free(pm, sp->sg_pmeg); @@ -4477,7 +4477,7 @@ pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot) region_free(pm, rp->rg_smeg); } #endif - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; GAP_WIDEN(pm,vr); } @@ -4805,7 +4805,7 @@ pmap_page_protect4m(struct vm_page *pg, vm_prot_t prot) if (pm->pm_ctx) tlb_flush_context(); setpgt4m(&pm->pm_reg_ptps[vr], SRMMU_TEINVALID); - free(rp->rg_segmap, M_VMPMAP); + free(rp->rg_segmap, M_VMPMAP, 0); rp->rg_segmap = NULL; pool_put(&L23_pool, rp->rg_seg_ptps); } diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c index 410e829610c..9e933403d2c 100644 --- a/sys/arch/sparc/sparc/vm_machdep.c +++ b/sys/arch/sparc/sparc/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.56 2013/01/16 19:04:43 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.57 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */ /* @@ -107,7 +107,7 @@ dvma_malloc_space(len, kaddr, flags, space) *(vaddr_t *)kaddr = kva; dva = dvma_mapin_space(kernel_map, kva, len, (flags & M_NOWAIT) ? 0 : 1, space); if (dva == 0) { - free((void *)kva, M_DEVBUF); + free((void *)kva, M_DEVBUF, 0); return (NULL); } return (caddr_t)dva; @@ -133,7 +133,7 @@ dvma_free(dva, len, kaddr) if (!has_iocache) #endif kvm_recache(kaddr, atop(len)); - free((void *)kva, M_DEVBUF); + free((void *)kva, M_DEVBUF, 0); } u_long dvma_cachealign = 0; @@ -468,7 +468,7 @@ cpu_exit(p) savefpstate(fs); cpuinfo.fpproc = NULL; } - free((void *)fs, M_SUBPROC); + free((void *)fs, M_SUBPROC, 0); } pmap_deactivate(p); diff --git a/sys/arch/sparc/stand/common/dvma.c b/sys/arch/sparc/stand/common/dvma.c index bfb361057e9..0703791b693 100644 --- a/sys/arch/sparc/stand/common/dvma.c +++ b/sys/arch/sparc/stand/common/dvma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvma.c,v 1.5 2011/04/14 18:27:49 miod Exp $ */ +/* $OpenBSD: dvma.c,v 1.6 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: dvma.c,v 1.2 1995/09/17 00:50:56 pk Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -135,7 +135,7 @@ dvma_alloc(int len) return (dvma_mapin(mem, len)); } -extern void free(void *ptr, int len); +extern void free(void *ptr, int len, 0); void dvma_free(char *dvma, int len) { @@ -143,5 +143,5 @@ dvma_free(char *dvma, int len) mem = dvma_mapout(dvma, len); if (mem) - free(mem, len); + free(mem, len, 0); } diff --git a/sys/arch/sparc/stand/installboot/installboot.c b/sys/arch/sparc/stand/installboot/installboot.c index 3e09bcbe779..0409685f3cd 100644 --- a/sys/arch/sparc/stand/installboot/installboot.c +++ b/sys/arch/sparc/stand/installboot/installboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: installboot.c,v 1.8 2013/09/29 21:30:50 jmc Exp $ */ +/* $OpenBSD: installboot.c,v 1.9 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: installboot.c,v 1.1 1997/06/01 03:39:45 mrg Exp $ */ /* @@ -251,7 +251,7 @@ loadprotoblocks(fname, size) } if (read(fd, bp, statbuf.st_size) != statbuf.st_size) { warn("read: %s", fname); - free(bp); + free(bp, 0); close(fd); return NULL; } @@ -269,21 +269,21 @@ loadprotoblocks(fname, size) if ((int)block_table & 3) { warn("%s: invalid address: block_table = %x", fname, block_table); - free(bp); + free(bp, 0); close(fd); return NULL; } if ((int)block_count_p & 3) { warn("%s: invalid address: block_count_p = %x", fname, block_count_p); - free(bp); + free(bp, 0); close(fd); return NULL; } if ((int)block_size_p & 3) { warn("%s: invalid address: block_size_p = %x", fname, block_size_p); - free(bp); + free(bp, 0); close(fd); return NULL; } diff --git a/sys/arch/sparc/stand/installboot/nlist.c b/sys/arch/sparc/stand/installboot/nlist.c index 26b71dc5607..0b4b2d7ca47 100644 --- a/sys/arch/sparc/stand/installboot/nlist.c +++ b/sys/arch/sparc/stand/installboot/nlist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nlist.c,v 1.1 2013/10/30 18:04:47 deraadt Exp $ */ +/* $OpenBSD: nlist.c,v 1.2 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -137,7 +137,7 @@ __aout_fdnlist(int fd, struct nlist *list) } aout_done: if (usemalloc) - free(strtab); + free(strtab, 0); else munmap(strtab, strsize); return (nent); diff --git a/sys/arch/sparc64/dev/ce4231.c b/sys/arch/sparc64/dev/ce4231.c index a86d1192246..adb08d06851 100644 --- a/sys/arch/sparc64/dev/ce4231.c +++ b/sys/arch/sparc64/dev/ce4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ce4231.c,v 1.30 2013/05/16 06:31:50 kettenis Exp $ */ +/* $OpenBSD: ce4231.c,v 1.31 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -1386,7 +1386,7 @@ fail2: fail1: bus_dmamap_destroy(dmat, p->dmamap); fail: - free(p, pool); + free(p, pool, 0); return (NULL); } @@ -1408,7 +1408,7 @@ ce4231_free(addr, ptr, pool) bus_dmamem_free(dmat, p->segs, p->nsegs); bus_dmamap_destroy(dmat, p->dmamap); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } printf("%s: attempt to free rogue pointer\n", sc->sc_dev.dv_xname); diff --git a/sys/arch/sparc64/dev/central.c b/sys/arch/sparc64/dev/central.c index 764d01e2aa4..eaad29540db 100644 --- a/sys/arch/sparc64/dev/central.c +++ b/sys/arch/sparc64/dev/central.c @@ -1,4 +1,4 @@ -/* $OpenBSD: central.c,v 1.7 2010/11/11 17:58:23 miod Exp $ */ +/* $OpenBSD: central.c,v 1.8 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2004 Jason L. Wright (jason@thought.net) @@ -108,7 +108,7 @@ central_attach(parent, self, aux) (void)config_found(&sc->sc_dv, (void *)&ca, central_print); if (ca.ca_name != NULL) - free(ca.ca_name, M_DEVBUF); + free(ca.ca_name, M_DEVBUF, 0); } } diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index 04effe065db..99a162a073e 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.47 2014/03/29 18:09:30 guenther Exp $ */ +/* $OpenBSD: creator.c,v 1.48 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -762,7 +762,7 @@ creator_load_firmware(void *vsc) if (sizeof(*fw) > buflen || fw->fw_size * sizeof(u_int32_t) > (buflen - sizeof(*fw))) { printf("%s: corrupt firmware\n", sc->sc_sunfb.sf_dev.dv_xname); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return; } @@ -795,7 +795,7 @@ creator_load_firmware(void *vsc) creator_ras_wait(sc); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); } #endif /* SMALL_KERNEL */ diff --git a/sys/arch/sparc64/dev/ebus.c b/sys/arch/sparc64/dev/ebus.c index c0b6245264e..e7c4f667d11 100644 --- a/sys/arch/sparc64/dev/ebus.c +++ b/sys/arch/sparc64/dev/ebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ebus.c,v 1.22 2008/06/11 05:15:43 kettenis Exp $ */ +/* $OpenBSD: ebus.c,v 1.23 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: ebus.c,v 1.24 2001/07/25 03:49:54 eeh Exp $ */ /* @@ -272,13 +272,13 @@ void ebus_destroy_attach_args(struct ebus_attach_args *ea) { if (ea->ea_name) - free((void *)ea->ea_name, M_DEVBUF); + free((void *)ea->ea_name, M_DEVBUF, 0); if (ea->ea_regs) - free((void *)ea->ea_regs, M_DEVBUF); + free((void *)ea->ea_regs, M_DEVBUF, 0); if (ea->ea_intrs) - free((void *)ea->ea_intrs, M_DEVBUF); + free((void *)ea->ea_intrs, M_DEVBUF, 0); if (ea->ea_vaddrs) - free((void *)ea->ea_vaddrs, M_DEVBUF); + free((void *)ea->ea_vaddrs, M_DEVBUF, 0); } int diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index ee4d81a8c9c..159bc75aea0 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.44 2014/04/28 21:01:51 brad Exp $ */ +/* $OpenBSD: fd.c,v 1.45 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */ /*- @@ -1852,7 +1852,7 @@ fdioctl(dev, cmd, addr, flag, p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); fdgetdisklabel(dev, fd, lp, 0); bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); return 0; case DIOCGPDINFO: @@ -2012,7 +2012,7 @@ fdformat(dev, finfo, p) /* ...and wait for it to complete */ rv = biowait(bp); - free(bp, M_TEMP); + free(bp, M_TEMP, 0); return (rv); } diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c index 46abed25a34..0b75c88c3fb 100644 --- a/sys/arch/sparc64/dev/fhc.c +++ b/sys/arch/sparc64/dev/fhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fhc.c,v 1.18 2011/04/07 15:30:16 miod Exp $ */ +/* $OpenBSD: fhc.c,v 1.19 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2004 Jason L. Wright (jason@thought.net) @@ -118,13 +118,13 @@ fhc_attach(struct fhc_softc *sc) (void)config_found(&sc->sc_dv, (void *)&fa, fhc_print); if (fa.fa_name != NULL) - free(fa.fa_name, M_DEVBUF); + free(fa.fa_name, M_DEVBUF, 0); if (fa.fa_reg != NULL) - free(fa.fa_reg, M_DEVBUF); + free(fa.fa_reg, M_DEVBUF, 0); if (fa.fa_intr != NULL) - free(fa.fa_intr, M_DEVBUF); + free(fa.fa_intr, M_DEVBUF, 0); if (fa.fa_promvaddrs != NULL) - free(fa.fa_promvaddrs, M_DEVBUF); + free(fa.fa_promvaddrs, M_DEVBUF, 0); } sc->sc_blink.bl_func = fhc_led_blink; diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c index 151f59531d2..15c07e44f77 100644 --- a/sys/arch/sparc64/dev/iommu.c +++ b/sys/arch/sparc64/dev/iommu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iommu.c,v 1.68 2014/05/10 12:20:38 kettenis Exp $ */ +/* $OpenBSD: iommu.c,v 1.69 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */ /* @@ -1660,7 +1660,7 @@ iommu_iomap_destroy(struct iommu_map_state *ims) ims->ims_map.ipm_pagecnt); #endif - free(ims, M_DEVBUF); + free(ims, M_DEVBUF, 0); } /* diff --git a/sys/arch/sparc64/dev/ldc.c b/sys/arch/sparc64/dev/ldc.c index 38173b398e4..6fa6b38afe5 100644 --- a/sys/arch/sparc64/dev/ldc.c +++ b/sys/arch/sparc64/dev/ldc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldc.c,v 1.9 2012/10/21 18:56:00 kettenis Exp $ */ +/* $OpenBSD: ldc.c,v 1.10 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -508,7 +508,7 @@ ldc_queue_free(bus_dma_tag_t t, struct ldc_queue *lq) bus_dmamem_unmap(t, lq->lq_va, size); bus_dmamem_free(t, &lq->lq_seg, 1); bus_dmamap_destroy(t, lq->lq_map); - free(lq, M_DEVBUF); + free(lq, M_DEVBUF, 0); } struct ldc_map * @@ -568,5 +568,5 @@ ldc_map_free(bus_dma_tag_t t, struct ldc_map *lm) bus_dmamem_unmap(t, (caddr_t)lm->lm_slot, size); bus_dmamem_free(t, &lm->lm_seg, 1); bus_dmamap_destroy(t, lm->lm_map); - free(lm, M_DEVBUF); + free(lm, M_DEVBUF, 0); } diff --git a/sys/arch/sparc64/dev/msi.c b/sys/arch/sparc64/dev/msi.c index 1bd6cc9925d..5b8e5dd0336 100644 --- a/sys/arch/sparc64/dev/msi.c +++ b/sys/arch/sparc64/dev/msi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msi.c,v 1.1 2011/07/06 05:35:53 kettenis Exp $ */ +/* $OpenBSD: msi.c,v 1.2 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2011 Mark Kettenis <kettenis@openbsd.org> * @@ -82,5 +82,5 @@ msi_eq_free(bus_dma_tag_t t, struct msi_eq *meq) bus_dmamem_unmap(t, meq->meq_va, size); bus_dmamem_free(t, &meq->meq_seg, 1); bus_dmamap_destroy(t, meq->meq_map); - free(meq, M_DEVBUF); + free(meq, M_DEVBUF, 0); } diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c index 04292caa1d5..f83d2a8ab49 100644 --- a/sys/arch/sparc64/dev/psycho.c +++ b/sys/arch/sparc64/dev/psycho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psycho.c,v 1.71 2014/07/12 14:12:44 uebayasi Exp $ */ +/* $OpenBSD: psycho.c,v 1.72 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */ /* @@ -891,7 +891,7 @@ psycho_iommu_init(struct psycho_softc *sc, int tsbsize) } #undef TSBCASE DPRINTF(PDB_CONF, ("psycho_iommu_init: iobase=0x%x\n", iobase)); - free(vdma, M_DEVBUF); + free(vdma, M_DEVBUF, 0); } else { DPRINTF(PDB_CONF, ("psycho_iommu_init: getprop failed, " "iobase=0x%x, tsbsize=%d\n", iobase, tsbsize)); diff --git a/sys/arch/sparc64/dev/pyro.c b/sys/arch/sparc64/dev/pyro.c index daf02c992a7..d79cb427d4e 100644 --- a/sys/arch/sparc64/dev/pyro.c +++ b/sys/arch/sparc64/dev/pyro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pyro.c,v 1.26 2014/01/21 10:59:30 dlg Exp $ */ +/* $OpenBSD: pyro.c,v 1.27 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -250,7 +250,7 @@ pyro_init(struct pyro_softc *sc, int busa) pba.pba_pc->conf_write = pyro_conf_write; pba.pba_pc->intr_map = pyro_intr_map; - free(busranges, M_DEVBUF); + free(busranges, M_DEVBUF, 0); #ifdef DDB db_register_xir(pyro_xir, sc); @@ -347,7 +347,7 @@ pyro_init_msi(struct pyro_softc *sc, struct pyro_pbm *pbm) return; free_table: - free(pbm->pp_msi, M_DEVBUF); + free(pbm->pp_msi, M_DEVBUF, 0); } int diff --git a/sys/arch/sparc64/dev/sbus.c b/sys/arch/sparc64/dev/sbus.c index 082d015f6b5..15b5d886eb3 100644 --- a/sys/arch/sparc64/dev/sbus.c +++ b/sys/arch/sparc64/dev/sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sbus.c,v 1.40 2014/07/12 14:12:44 uebayasi Exp $ */ +/* $OpenBSD: sbus.c,v 1.41 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: sbus.c,v 1.46 2001/10/07 20:30:41 eeh Exp $ */ /*- @@ -484,16 +484,16 @@ void sbus_destroy_attach_args(struct sbus_attach_args *sa) { if (sa->sa_name != NULL) - free(sa->sa_name, M_DEVBUF); + free(sa->sa_name, M_DEVBUF, 0); if (sa->sa_nreg != 0) - free(sa->sa_reg, M_DEVBUF); + free(sa->sa_reg, M_DEVBUF, 0); if (sa->sa_intr) - free(sa->sa_intr, M_DEVBUF); + free(sa->sa_intr, M_DEVBUF, 0); if (sa->sa_promvaddrs) - free((void *)sa->sa_promvaddrs, M_DEVBUF); + free((void *)sa->sa_promvaddrs, M_DEVBUF, 0); bzero(sa, sizeof(struct sbus_attach_args)); /*DEBUG*/ } @@ -638,7 +638,7 @@ sbus_get_intr(struct sbus_softc *sc, int node, struct sbus_intr **ipp, int *np, ip[n].sbi_pri = pri | ipl[n]; ip[n].sbi_vec = ipl[n]; } - free(ipl, M_DEVBUF); + free(ipl, M_DEVBUF, 0); *ipp = ip; } diff --git a/sys/arch/sparc64/dev/schizo.c b/sys/arch/sparc64/dev/schizo.c index 251fb94467b..1bedaf5fb81 100644 --- a/sys/arch/sparc64/dev/schizo.c +++ b/sys/arch/sparc64/dev/schizo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: schizo.c,v 1.65 2014/05/10 12:18:38 kettenis Exp $ */ +/* $OpenBSD: schizo.c,v 1.66 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -244,7 +244,7 @@ schizo_init(struct schizo_softc *sc, int busa) pba.pba_pc->conf_write = schizo_conf_write; pba.pba_pc->intr_map = schizo_intr_map; - free(busranges, M_DEVBUF); + free(busranges, M_DEVBUF, 0); schizo_pbm_write(pbm, SCZ_PCI_INTR_RETRY, 5); @@ -445,7 +445,7 @@ schizo_init_iommu(struct schizo_softc *sc, struct schizo_pbm *pbm) } #undef TSBCASE DPRINTF(SDB_BUSMAP, ("schizo_iommu_init: iobase=0x%x\n", iobase)); - free(vdma, M_DEVBUF); + free(vdma, M_DEVBUF, 0); } else { DPRINTF(SDB_BUSMAP, ("schizo_iommu_init: getprop failed, " "using iobase=0x%x, tsbsize=%d\n", iobase, tsbsize)); @@ -557,7 +557,7 @@ schizo_set_intr(struct schizo_softc *sc, struct schizo_pbm *pbm, int ipl, map, clr, name); if (ih == NULL) { printf("set_intr failed...\n"); - free(name, M_DEVBUF); + free(name, M_DEVBUF, 0); return; } diff --git a/sys/arch/sparc64/dev/ssm.c b/sys/arch/sparc64/dev/ssm.c index 75ddf46a67c..0757aff3cd9 100644 --- a/sys/arch/sparc64/dev/ssm.c +++ b/sys/arch/sparc64/dev/ssm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssm.c,v 1.1 2008/07/06 08:51:44 kettenis Exp $ */ +/* $OpenBSD: ssm.c,v 1.2 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -74,7 +74,7 @@ ssm_attach(struct device *parent, struct device *self, void *aux) getprop(node, "reg", sizeof(*nma.ma_reg), &nma.ma_nreg, (void **)&nma.ma_reg); config_found(self, &nma, ssm_print); - free(nma.ma_reg, M_DEVBUF); + free(nma.ma_reg, M_DEVBUF, 0); } } diff --git a/sys/arch/sparc64/dev/vbus.c b/sys/arch/sparc64/dev/vbus.c index 9af35be6b06..72e8ff49f49 100644 --- a/sys/arch/sparc64/dev/vbus.c +++ b/sys/arch/sparc64/dev/vbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vbus.c,v 1.6 2013/07/16 21:08:06 kettenis Exp $ */ +/* $OpenBSD: vbus.c,v 1.7 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -168,7 +168,7 @@ vbus_intr_map(int node, int ino, uint64_t *sysino) node = imap[address_cells + interrupt_cells]; devino = imap[address_cells + interrupt_cells + 1]; - free(reg, M_DEVBUF); + free(reg, M_DEVBUF, 0); reg = NULL; getprop(node, "reg", sizeof(*reg), &nreg, (void **)®); diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 9dcdba71c9d..a097db72afd 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.38 2014/05/10 11:49:31 kettenis Exp $ */ +/* $OpenBSD: vdsk.c,v 1.39 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -920,7 +920,7 @@ vdsk_dring_free(bus_dma_tag_t t, struct vdsk_dring *vd) bus_dmamem_unmap(t, (caddr_t)vd->vd_desc, size); bus_dmamem_free(t, &vd->vd_seg, 1); bus_dmamap_destroy(t, vd->vd_map); - free(vd, M_DEVBUF); + free(vd, M_DEVBUF, 0); } void * diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c index 4133738a7c6..86af11cc035 100644 --- a/sys/arch/sparc64/dev/vdsp.c +++ b/sys/arch/sparc64/dev/vdsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsp.c,v 1.26 2014/05/10 11:49:31 kettenis Exp $ */ +/* $OpenBSD: vdsp.c,v 1.27 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2009, 2011, 2014 Mark Kettenis * @@ -848,15 +848,15 @@ vdsp_ldc_reset(struct ldc_conn *lc) sc->sc_vio_state = 0; sc->sc_seq_no = 0; if (sc->sc_vd) { - free(sc->sc_vd, M_DEVBUF); + free(sc->sc_vd, M_DEVBUF, 0); sc->sc_vd = NULL; } if (sc->sc_vd_task) { - free(sc->sc_vd_task, M_DEVBUF); + free(sc->sc_vd_task, M_DEVBUF, 0); sc->sc_vd_task = NULL; } if (sc->sc_label) { - free(sc->sc_label, M_DEVBUF); + free(sc->sc_label, M_DEVBUF, 0); sc->sc_label = NULL; } @@ -984,7 +984,7 @@ vdsp_readlabel(struct vdsp_softc *sc) err = VOP_READ(sc->sc_vp, &uio, 0, p->p_ucred); VOP_UNLOCK(sc->sc_vp, 0, p); if (err) { - free(sc->sc_label, M_DEVBUF); + free(sc->sc_label, M_DEVBUF, 0); sc->sc_label = NULL; } } @@ -1048,7 +1048,7 @@ vdsp_is_iso(struct vdsp_softc *sc) if (err == 0 && memcmp(vdp->id, ISO_STANDARD_ID, sizeof(vdp->id))) err = ENOENT; - free(vdp, M_DEVBUF); + free(vdp, M_DEVBUF, 0); return (err == 0); } @@ -1145,7 +1145,7 @@ vdsp_read_desc(struct vdsp_softc *sc, struct vdsk_desc_msg *dm) } fail: - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); /* ACK the descriptor. */ dm->tag.stype = VIO_SUBTYPE_ACK; @@ -1216,7 +1216,7 @@ vdsp_read_dring(void *arg1, void *arg2) } fail: - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); /* ACK the descriptor. */ vd->hdr.dstate = VIO_DESC_DONE; @@ -1283,7 +1283,7 @@ vdsp_write_dring(void *arg1, void *arg2) VOP_UNLOCK(sc->sc_vp, 0, p); fail: - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); /* ACK the descriptor. */ vd->hdr.dstate = VIO_DESC_DONE; @@ -1396,7 +1396,7 @@ vdsp_get_vtoc(void *arg1, void *arg2) vd->status = 0; fail: - free(vt, M_DEVBUF); + free(vt, M_DEVBUF, 0); /* ACK the descriptor. */ vd->hdr.dstate = VIO_DESC_DONE; @@ -1488,7 +1488,7 @@ vdsp_set_vtoc(void *arg1, void *arg2) vd->status = vdsp_writelabel(sc); fail: - free(vt, M_DEVBUF); + free(vt, M_DEVBUF, 0); /* ACK the descriptor. */ vd->hdr.dstate = VIO_DESC_DONE; @@ -1581,7 +1581,7 @@ vdsp_get_diskgeom(void *arg1, void *arg2) vd->status = 0; fail: - free(vg, M_DEVBUF); + free(vg, M_DEVBUF, 0); /* ACK the descriptor. */ vd->hdr.dstate = VIO_DESC_DONE; diff --git a/sys/arch/sparc64/dev/vldcp.c b/sys/arch/sparc64/dev/vldcp.c index f71648b784a..9de4aac57af 100644 --- a/sys/arch/sparc64/dev/vldcp.c +++ b/sys/arch/sparc64/dev/vldcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vldcp.c,v 1.8 2014/05/10 11:49:31 kettenis Exp $ */ +/* $OpenBSD: vldcp.c,v 1.9 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2009, 2012 Mark Kettenis * @@ -509,13 +509,13 @@ vldcpioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) hi->hi_cookie + offset, pa, nbytes, &nbytes); if (err != H_EOK) { printf("hv_ldc_copy %d\n", err); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); device_unref(&sc->sc_dv); return (EINVAL); } err = copyout(buf, (caddr_t)hi->hi_addr + offset, nbytes); if (err) { - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); device_unref(&sc->sc_dv); return (err); } @@ -531,7 +531,7 @@ vldcpioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) nbytes = min(PAGE_SIZE, size); err = copyin((caddr_t)hi->hi_addr + offset, buf, nbytes); if (err) { - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); device_unref(&sc->sc_dv); return (err); } @@ -539,7 +539,7 @@ vldcpioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) hi->hi_cookie + offset, pa, nbytes, &nbytes); if (err != H_EOK) { printf("hv_ldc_copy %d\n", err); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); device_unref(&sc->sc_dv); return (EINVAL); } @@ -550,7 +550,7 @@ vldcpioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) } - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); device_unref(&sc->sc_dv); return (0); diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c index b594c8106bd..7684fb0cc30 100644 --- a/sys/arch/sparc64/dev/vnet.c +++ b/sys/arch/sparc64/dev/vnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnet.c,v 1.32 2014/07/08 02:59:51 dlg Exp $ */ +/* $OpenBSD: vnet.c,v 1.33 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -1492,5 +1492,5 @@ vnet_dring_free(bus_dma_tag_t t, struct vnet_dring *vd) bus_dmamem_unmap(t, (caddr_t)vd->vd_desc, size); bus_dmamem_free(t, &vd->vd_seg, 1); bus_dmamap_destroy(t, vd->vd_map); - free(vd, M_DEVBUF); + free(vd, M_DEVBUF, 0); } diff --git a/sys/arch/sparc64/dev/vpci.c b/sys/arch/sparc64/dev/vpci.c index cad8e10d7f9..d5ba8b60227 100644 --- a/sys/arch/sparc64/dev/vpci.c +++ b/sys/arch/sparc64/dev/vpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vpci.c,v 1.14 2014/05/10 11:49:31 kettenis Exp $ */ +/* $OpenBSD: vpci.c,v 1.15 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2008 Mark Kettenis <kettenis@openbsd.org> * @@ -203,7 +203,7 @@ vpci_attach(struct device *parent, struct device *self, void *aux) pba.pba_pc->conf_write = vpci_conf_write; pba.pba_pc->intr_map = vpci_intr_map; - free(busranges, M_DEVBUF); + free(busranges, M_DEVBUF, 0); config_found(&sc->sc_dv, &pba, vpci_print); } @@ -280,7 +280,7 @@ disable_queue: free_queue: msi_eq_free(sc->sc_dmat, pbm->vp_meq); free_table: - free(pbm->vp_msi, M_DEVBUF); + free(pbm->vp_msi, M_DEVBUF, 0); } int diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 59c6989bf21..ce350aabe20 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.119 2014/05/10 12:29:58 kettenis Exp $ */ +/* $OpenBSD: autoconf.c,v 1.120 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -1013,7 +1013,7 @@ extern bus_space_tag_t mainbus_space_tag; rv = getprop(node, "interrupts", sizeof(*ma.ma_interrupts), &ma.ma_ninterrupts, (void **)&ma.ma_interrupts); if (rv != 0 && rv != ENOENT) { - free(ma.ma_reg, M_DEVBUF); + free(ma.ma_reg, M_DEVBUF, 0); continue; } #ifdef DEBUG @@ -1028,9 +1028,9 @@ extern bus_space_tag_t mainbus_space_tag; rv = getprop(node, "address", sizeof(*ma.ma_address), &ma.ma_naddress, (void **)&ma.ma_address); if (rv != 0 && rv != ENOENT) { - free(ma.ma_reg, M_DEVBUF); + free(ma.ma_reg, M_DEVBUF, 0); if (ma.ma_ninterrupts) - free(ma.ma_interrupts, M_DEVBUF); + free(ma.ma_interrupts, M_DEVBUF, 0); continue; } #ifdef DEBUG @@ -1043,11 +1043,11 @@ extern bus_space_tag_t mainbus_space_tag; } #endif config_found(dev, &ma, mbprint); - free(ma.ma_reg, M_DEVBUF); + free(ma.ma_reg, M_DEVBUF, 0); if (ma.ma_ninterrupts) - free(ma.ma_interrupts, M_DEVBUF); + free(ma.ma_interrupts, M_DEVBUF, 0); if (ma.ma_naddress) - free(ma.ma_address, M_DEVBUF); + free(ma.ma_address, M_DEVBUF, 0); } extern int prom_cngetc(dev_t); diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c index 8ab51015522..70209032749 100644 --- a/sys/arch/sparc64/sparc64/clock.c +++ b/sys/arch/sparc64/sparc64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.53 2014/05/10 12:15:19 kettenis Exp $ */ +/* $OpenBSD: clock.c,v 1.54 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */ /* @@ -445,7 +445,7 @@ getidprom() if (getprop(node, "idprom", sizeof(*idp), &n, (void **)&idp) != 0) return (NULL); if (n != 1) { - free(idp, M_DEVBUF); + free(idp, M_DEVBUF, 0); return (NULL); } return (idp); @@ -544,7 +544,7 @@ myetheraddr(cp) cp[4] = idp->id_ether[4]; cp[5] = idp->id_ether[5]; if (idprom == NULL) - free(idp, M_DEVBUF); + free(idp, M_DEVBUF, 0); } /* diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c index 0a61f1dc8e3..536dde01d22 100644 --- a/sys/arch/sparc64/sparc64/intr.c +++ b/sys/arch/sparc64/sparc64/intr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.c,v 1.48 2014/05/10 12:29:58 kettenis Exp $ */ +/* $OpenBSD: intr.c,v 1.49 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */ /* @@ -339,7 +339,7 @@ void softintr_disestablish(cookie) void *cookie; { - free(cookie, M_DEVBUF); + free(cookie, M_DEVBUF, 0); } void diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index e6a9c12142d..b3f721a9b24 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.163 2014/07/11 22:28:06 uebayasi Exp $ */ +/* $OpenBSD: machdep.c,v 1.164 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -325,7 +325,7 @@ setregs(p, pack, stack, retval) * to save it. In any case, get rid of our FPU state. */ fpusave_proc(p, 0); - free(p->p_md.md_fpstate, M_SUBPROC); + free(p->p_md.md_fpstate, M_SUBPROC, 0); p->p_md.md_fpstate = NULL; } bzero((caddr_t)tf, sizeof *tf); @@ -1002,7 +1002,7 @@ _bus_dmamap_destroy(t, t0, map) if (map->dm_nsegs) bus_dmamap_unload(t0, map); - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* @@ -1420,7 +1420,7 @@ _bus_dmamem_free(t, t0, segs, nsegs) * Return the list of pages back to the VM system. */ uvm_pglistfree(segs[0]._ds_mlist); - free(segs[0]._ds_mlist, M_DEVBUF); + free(segs[0]._ds_mlist, M_DEVBUF, 0); } /* @@ -1814,7 +1814,7 @@ bus_intr_allocate(bus_space_tag_t t, int (*handler)(void *), void *arg, void bus_intr_free(void *arg) { - free(arg, M_DEVBUF); + free(arg, M_DEVBUF, 0); } void * diff --git a/sys/arch/sparc64/sparc64/openprom.c b/sys/arch/sparc64/sparc64/openprom.c index 8bd95266089..d1897970239 100644 --- a/sys/arch/sparc64/sparc64/openprom.c +++ b/sys/arch/sparc64/sparc64/openprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openprom.c,v 1.17 2011/06/17 07:06:46 mk Exp $ */ +/* $OpenBSD: openprom.c,v 1.18 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */ /* @@ -307,9 +307,9 @@ openpromioctl(dev, cmd, data, flags, p) } if (name) - free(name, M_TEMP); + free(name, M_TEMP, 0); if (value) - free(value, M_TEMP); + free(value, M_TEMP, 0); return (error); } diff --git a/sys/arch/sparc64/sparc64/vm_machdep.c b/sys/arch/sparc64/sparc64/vm_machdep.c index f768148dda2..a1af56aa942 100644 --- a/sys/arch/sparc64/sparc64/vm_machdep.c +++ b/sys/arch/sparc64/sparc64/vm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm_machdep.c,v 1.29 2013/01/16 19:04:43 miod Exp $ */ +/* $OpenBSD: vm_machdep.c,v 1.30 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: vm_machdep.c,v 1.38 2001/06/30 00:02:20 eeh Exp $ */ /* @@ -367,7 +367,7 @@ cpu_exit(struct proc *p) { if (p->p_md.md_fpstate != NULL) { fpusave_proc(p, 0); - free(p->p_md.md_fpstate, M_SUBPROC); + free(p->p_md.md_fpstate, M_SUBPROC, 0); } pmap_deactivate(p); diff --git a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c index 7ac6fcaa07e..647cfa9bb86 100644 --- a/sys/arch/sparc64/stand/ofwboot/elf64_exec.c +++ b/sys/arch/sparc64/stand/ofwboot/elf64_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf64_exec.c,v 1.4 2013/12/28 21:00:21 kettenis Exp $ */ +/* $OpenBSD: elf64_exec.c,v 1.5 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: elfXX_exec.c,v 1.2 2001/08/15 20:08:15 eeh Exp $ */ /* @@ -171,7 +171,7 @@ elf64_exec(int fd, Elf_Ehdr *elf, u_int64_t *entryp, void **ssymp, void **esymp) elf->e_phnum = 0; bcopy(elf, addr, sizeof(Elf_Ehdr)); bcopy(shp, addr + sizeof(Elf_Ehdr), elf->e_shnum * sizeof(Elf_Shdr)); - free(shp, elf->e_shnum * sizeof(Elf_Shdr)); + free(shp, elf->e_shnum * sizeof(Elf_Shdr), 0); *ssymp = addr; /* diff --git a/sys/arch/vax/if/if_qe.c b/sys/arch/vax/if/if_qe.c index 105ae1d0609..b413c2ec7cf 100644 --- a/sys/arch/vax/if/if_qe.c +++ b/sys/arch/vax/if/if_qe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_qe.c,v 1.26 2013/11/27 08:56:31 mpi Exp $ */ +/* $OpenBSD: if_qe.c,v 1.27 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: if_qe.c,v 1.51 2002/06/08 12:28:37 ragge Exp $ */ /* * Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved. @@ -195,7 +195,7 @@ qematch(struct device *parent, struct cfdata *cf, void *aux) * All done with the bus resources. */ ubfree((void *)parent, &ui); - free(ring, M_TEMP); + free(ring, M_TEMP, 0); return 1; } diff --git a/sys/arch/vax/if/if_uba.c b/sys/arch/vax/if/if_uba.c index 33a8e1ce022..5c7dbdd9683 100644 --- a/sys/arch/vax/if/if_uba.c +++ b/sys/arch/vax/if/if_uba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uba.c,v 1.11 2003/11/10 21:05:04 miod Exp $ */ +/* $OpenBSD: if_uba.c,v 1.12 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: if_uba.c,v 1.15 1999/01/01 21:43:18 ragge Exp $ */ /* @@ -135,7 +135,7 @@ bad: ubarelse(ifu->iff_softc, &ifw[nw].ifw_info); while (--nr >= 0) ubarelse(ifu->iff_softc, &ifr[nr].ifrw_info); - free(cp, M_DEVBUF); + free(cp, M_DEVBUF, 0); ifr[0].ifrw_addr = 0; return (0); } diff --git a/sys/arch/vax/mbus/legss.c b/sys/arch/vax/mbus/legss.c index 7fcb5adef35..7a078a20a9b 100644 --- a/sys/arch/vax/mbus/legss.c +++ b/sys/arch/vax/mbus/legss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: legss.c,v 1.6 2013/10/21 10:36:20 miod Exp $ */ +/* $OpenBSD: legss.c,v 1.7 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -254,7 +254,7 @@ bad2: vax_unmap_physmem(scr->ss_vram, (LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY) / VAX_NBPG); bad1: - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); } /* diff --git a/sys/arch/vax/mscp/mscp.c b/sys/arch/vax/mscp/mscp.c index 01fd2cd044e..bbb7234429c 100644 --- a/sys/arch/vax/mscp/mscp.c +++ b/sys/arch/vax/mscp/mscp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mscp.c,v 1.11 2012/12/05 23:20:15 deraadt Exp $ */ +/* $OpenBSD: mscp.c,v 1.12 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: mscp.c,v 1.16 2001/11/13 07:38:28 lukem Exp $ */ /* @@ -183,7 +183,7 @@ loop: panic("mscp_dorsp"); if (mi->mi_driveno) { bcopy(mi->mi_dp, tmp, mi->mi_driveno); - free(mi->mi_dp, mi->mi_driveno); + free(mi->mi_dp, mi->mi_driveno, 0); } mi->mi_driveno = tmpno; mi->mi_dp = tmp; diff --git a/sys/arch/vax/qbus/uda.c b/sys/arch/vax/qbus/uda.c index 89c55fa3eac..b4145f98f5d 100644 --- a/sys/arch/vax/qbus/uda.c +++ b/sys/arch/vax/qbus/uda.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uda.c,v 1.9 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: uda.c,v 1.10 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: uda.c,v 1.36 2000/06/04 06:17:05 matt Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -331,7 +331,7 @@ udaready(uu) return 0; mscp_dgo(sc->sc_softc, mxi); sc->sc_inq--; - free(uu, M_DEVBUF); + free(uu, M_DEVBUF, 0); return 1; } diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c index f59b5c4a23f..edb6a74f612 100644 --- a/sys/arch/vax/vax/bus_dma.c +++ b/sys/arch/vax/vax/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.28 2014/07/11 09:36:26 mpi Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.29 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */ /*- @@ -137,7 +137,7 @@ _bus_dmamap_destroy(t, map) if (map->dm_nsegs > 0) printf("bus_dmamap_destroy() called for map with valid mappings\n"); #endif /* DIAGNOSTIC */ - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); } /* diff --git a/sys/arch/vax/vax/softintr.c b/sys/arch/vax/vax/softintr.c index e48c1af132a..812e10f3cf7 100644 --- a/sys/arch/vax/vax/softintr.c +++ b/sys/arch/vax/vax/softintr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softintr.c,v 1.3 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: softintr.c,v 1.4 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */ /* @@ -149,7 +149,7 @@ softintr_disestablish(void *arg) } mtx_leave(&siq->siq_mtx); - free(sih, M_DEVBUF); + free(sih, M_DEVBUF, 0); } /* diff --git a/sys/arch/vax/vsa/gpx.c b/sys/arch/vax/vsa/gpx.c index fca9d006ed4..600a1518d0a 100644 --- a/sys/arch/vax/vsa/gpx.c +++ b/sys/arch/vax/vsa/gpx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpx.c,v 1.23 2013/10/21 10:36:20 miod Exp $ */ +/* $OpenBSD: gpx.c,v 1.24 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -385,7 +385,7 @@ bad3: bad2: vax_unmap_physmem((vaddr_t)scr->ss_adder, 1); bad1: - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); } /* diff --git a/sys/arch/vax/vsa/lcg.c b/sys/arch/vax/vsa/lcg.c index 26d27a9fab8..c3f608ba21e 100644 --- a/sys/arch/vax/vsa/lcg.c +++ b/sys/arch/vax/vsa/lcg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcg.c,v 1.21 2013/10/21 10:36:21 miod Exp $ */ +/* $OpenBSD: lcg.c,v 1.22 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -317,7 +317,7 @@ fail3: fail2: vax_unmap_physmem((vaddr_t)ss->ss_addr, ss->ss_fbsize / VAX_NBPG); fail1: - free(ss, M_DEVBUF); + free(ss, M_DEVBUF, 0); } /* diff --git a/sys/arch/vax/vsa/lcspx.c b/sys/arch/vax/vsa/lcspx.c index 90a1b43b72b..131a88fc5db 100644 --- a/sys/arch/vax/vsa/lcspx.c +++ b/sys/arch/vax/vsa/lcspx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lcspx.c,v 1.19 2013/10/21 10:36:21 miod Exp $ */ +/* $OpenBSD: lcspx.c,v 1.20 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2006 Miodrag Vallat. * @@ -367,7 +367,7 @@ fail2: vax_unmap_physmem((vaddr_t)ss->ss_ramdac[i], 1); vax_unmap_physmem(ss->ss_reg, LCSPX_REG_SIZE / VAX_NBPG); fail1: - free(ss, M_DEVBUF); + free(ss, M_DEVBUF, 0); } static __inline__ void diff --git a/sys/arch/vax/vsa/smg.c b/sys/arch/vax/vsa/smg.c index 8b24196b465..768f33b6b3a 100644 --- a/sys/arch/vax/vsa/smg.c +++ b/sys/arch/vax/vsa/smg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smg.c,v 1.26 2013/10/21 10:36:21 miod Exp $ */ +/* $OpenBSD: smg.c,v 1.27 2014/07/12 18:44:43 tedu Exp $ */ /* $NetBSD: smg.c,v 1.21 2000/03/23 06:46:44 thorpej Exp $ */ /* * Copyright (c) 2006, Miodrag Vallat @@ -294,7 +294,7 @@ smg_attach(struct device *parent, struct device *self, void *aux) (caddr_t)vax_map_physmem(SMADDR, SMSIZE / VAX_NBPG); if (scr->ss_addr == NULL) { printf(": can not map frame buffer\n"); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return; } @@ -304,7 +304,7 @@ smg_attach(struct device *parent, struct device *self, void *aux) printf(": can not map cursor chip\n"); vax_unmap_physmem((vaddr_t)scr->ss_addr, SMSIZE / VAX_NBPG); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return; } @@ -313,7 +313,7 @@ smg_attach(struct device *parent, struct device *self, void *aux) vax_unmap_physmem((vaddr_t)scr->ss_cursor, 1); vax_unmap_physmem((vaddr_t)scr->ss_addr, SMSIZE / VAX_NBPG); - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return; } } diff --git a/sys/arch/zaurus/dev/zaurus_flash.c b/sys/arch/zaurus/dev/zaurus_flash.c index 8ded12ef0c5..1a474642718 100644 --- a/sys/arch/zaurus/dev/zaurus_flash.c +++ b/sys/arch/zaurus/dev/zaurus_flash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_flash.c,v 1.12 2014/05/08 21:17:01 miod Exp $ */ +/* $OpenBSD: zaurus_flash.c,v 1.13 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@openbsd.org> @@ -583,15 +583,15 @@ zflash_write_strategy(struct zflash_softc *sc, struct buf *bp, } bp->b_resid = bp->b_bcount - sc->sc_flash.sc_flashdev->pagesize; - free(oob, M_DEVBUF); - free(buf, M_DEVBUF); + free(oob, M_DEVBUF, 0); + free(buf, M_DEVBUF, 0); return; bad: bp->b_flags |= B_ERROR; if (oob != NULL) - free(oob, M_DEVBUF); + free(oob, M_DEVBUF, 0); if (buf != NULL) - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); } int @@ -650,7 +650,7 @@ zflash_safe_start(struct zflash_softc *sc, dev_t dev) phyuse = (u_int16_t *)malloc(sp->sp_pblks * sizeof(u_int16_t), M_DEVBUF, M_NOWAIT); if (phyuse == NULL) { - free(sp, M_DEVBUF); + free(sp, M_DEVBUF, 0); return ENOMEM; } sp->sp_phyuse = phyuse; @@ -659,8 +659,8 @@ zflash_safe_start(struct zflash_softc *sc, dev_t dev) logmap = (u_int *)malloc(sp->sp_lblks * sizeof(u_int), M_DEVBUF, M_NOWAIT); if (logmap == NULL) { - free(phyuse, M_DEVBUF); - free(sp, M_DEVBUF); + free(phyuse, M_DEVBUF, 0); + free(sp, M_DEVBUF, 0); return ENOMEM; } sp->sp_logmap = logmap; @@ -747,9 +747,9 @@ zflash_safe_stop(struct zflash_softc *sc, dev_t dev) return; sp = sc->sc_safe[part]; - free(sp->sp_phyuse, M_DEVBUF); - free(sp->sp_logmap, M_DEVBUF); - free(sp, M_DEVBUF); + free(sp->sp_phyuse, M_DEVBUF, 0); + free(sp->sp_logmap, M_DEVBUF, 0); + free(sp, M_DEVBUF, 0); sc->sc_safe[part] = NULL; } diff --git a/sys/arch/zaurus/stand/zboot/diskprobe.c b/sys/arch/zaurus/stand/zboot/diskprobe.c index c776b372c75..9f04963575e 100644 --- a/sys/arch/zaurus/stand/zboot/diskprobe.c +++ b/sys/arch/zaurus/stand/zboot/diskprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskprobe.c,v 1.3 2006/10/13 00:00:55 krw Exp $ */ +/* $OpenBSD: diskprobe.c,v 1.4 2014/07/12 18:44:43 tedu Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -74,7 +74,7 @@ hardprobe(void) bzero(dip, sizeof(*dip)); if (bios_getdiskinfo(order[i], &dip->bios_info) != NULL) { - free(dip, 0); + free(dip, 0, 0); continue; } diff --git a/sys/kern/exec_elf.c b/sys/kern/exec_elf.c index 5d7f006a28b..7df3832810e 100644 --- a/sys/kern/exec_elf.c +++ b/sys/kern/exec_elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_elf.c,v 1.98 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: exec_elf.c,v 1.99 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -490,7 +490,7 @@ ELFNAME(load_file)(struct proc *p, char *path, struct exec_package *epp, bad1: VOP_CLOSE(nd.ni_vp, FREAD, p->p_ucred, p); bad: - free(ph, M_TEMP); + free(ph, M_TEMP, 0); *last = addr; vput(nd.ni_vp); @@ -750,14 +750,14 @@ ELFNAME2(exec,makecmds)(struct proc *p, struct exec_package *epp) epp->ep_interp_pos = pos; } - free(ph, M_TEMP); + free(ph, M_TEMP, 0); vn_marktext(epp->ep_vp); return (exec_setup_stack(p, epp)); bad: if (interp) pool_put(&namei_pool, interp); - free(ph, M_TEMP); + free(ph, M_TEMP, 0); kill_vmcmds(&epp->ep_vmcmds); return (ENOEXEC); } @@ -783,7 +783,7 @@ ELFNAME2(exec,fixup)(struct proc *p, struct exec_package *epp) ap = epp->ep_emul_arg; if ((error = ELFNAME(load_file)(p, interp, epp, ap, &pos)) != 0) { - free(ap, M_TEMP); + free(ap, M_TEMP, 0); pool_put(&namei_pool, interp); kill_vmcmds(&epp->ep_vmcmds); return (error); @@ -834,7 +834,7 @@ ELFNAME2(exec,fixup)(struct proc *p, struct exec_package *epp) error = copyout(ai, epp->ep_emul_argp, sizeof ai); } - free(ap, M_TEMP); + free(ap, M_TEMP, 0); pool_put(&namei_pool, interp); return (error); } @@ -879,7 +879,7 @@ ELFNAME(os_pt_note)(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh, #if 0 if (np->type != ELF_NOTE_TYPE_OSVERSION) { - free(np, M_TEMP); + free(np, M_TEMP, 0); np = NULL; continue; } @@ -902,9 +902,9 @@ ELFNAME(os_pt_note)(struct proc *p, struct exec_package *epp, Elf_Ehdr *eh, out3: error = ENOEXEC; out2: - free(np, M_TEMP); + free(np, M_TEMP, 0); out1: - free(hph, M_TEMP); + free(hph, M_TEMP, 0); return error; } @@ -1077,7 +1077,7 @@ ELFNAMEEND(coredump)(struct proc *p, void *cookie) } out: - free(psections, M_TEMP); + free(psections, M_TEMP, 0); return (error); #endif } diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 6fab186676f..a8e327e3ba1 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_script.c,v 1.29 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: exec_script.c,v 1.30 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: exec_script.c,v 1.13 1996/02/04 02:15:06 christos Exp $ */ /* @@ -311,10 +311,10 @@ fail: /* free the fake arg list, because we're not returning it */ if ((tmpsap = shellargp) != NULL) { while (*tmpsap != NULL) { - free(*tmpsap, M_EXEC); + free(*tmpsap, M_EXEC, 0); tmpsap++; } - free(shellargp, M_EXEC); + free(shellargp, M_EXEC, 0); } /* diff --git a/sys/kern/exec_subr.c b/sys/kern/exec_subr.c index a96deb31a5c..ae01762c5ba 100644 --- a/sys/kern/exec_subr.c +++ b/sys/kern/exec_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_subr.c,v 1.35 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: exec_subr.c,v 1.36 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: exec_subr.c,v 1.9 1994/12/04 03:10:42 mycroft Exp $ */ /* @@ -95,7 +95,7 @@ vmcmdset_extend(struct exec_vmcmd_set *evsp) M_WAITOK); bcopy(evsp->evs_cmds, nvcp, (ocnt * sizeof(struct exec_vmcmd))); if (evsp->evs_cmds != evsp->evs_start) - free(evsp->evs_cmds, M_EXEC); + free(evsp->evs_cmds, M_EXEC, 0); evsp->evs_cmds = nvcp; } @@ -116,7 +116,7 @@ kill_vmcmds(struct exec_vmcmd_set *evsp) */ evsp->evs_used = 0; if (evsp->evs_cmds != evsp->evs_start) - free(evsp->evs_cmds, M_EXEC); + free(evsp->evs_cmds, M_EXEC, 0); evsp->evs_cmds = evsp->evs_start; evsp->evs_cnt = EXEC_DEFAULT_VMCMD_SETSIZE; } @@ -307,7 +307,7 @@ vmcmd_randomize(struct proc *p, struct exec_vmcmd *cmd) buf = malloc(cmd->ev_len, M_TEMP, M_WAITOK); arc4random_buf(buf, cmd->ev_len); error = copyout(buf, (void *)cmd->ev_addr, cmd->ev_len); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (error); } diff --git a/sys/kern/kern_bufq.c b/sys/kern/kern_bufq.c index 1aeade20884..911fe1b5f3d 100644 --- a/sys/kern/kern_bufq.c +++ b/sys/kern/kern_bufq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_bufq.c,v 1.27 2014/06/27 16:38:03 miod Exp $ */ +/* $OpenBSD: kern_bufq.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2010 Thordur I. Bjornsson <thib@openbsd.org> * Copyright (c) 2010 David Gwynne <dlg@openbsd.org> @@ -330,7 +330,7 @@ bufq_fifo_create(void) void bufq_fifo_destroy(void *data) { - free(data, M_DEVBUF); + free(data, M_DEVBUF, 0); } void @@ -447,7 +447,7 @@ bufq_nscan_create(void) void bufq_nscan_destroy(void *vdata) { - free(vdata, M_DEVBUF); + free(vdata, M_DEVBUF, 0); } void diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 6d9b15266fc..bd6c963cfe4 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_descrip.c,v 1.110 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_descrip.c,v 1.111 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */ /* @@ -781,7 +781,7 @@ fdexpand(struct proc *p) memset(newofileflags + copylen, 0, nfiles * sizeof(char) - copylen); if (fdp->fd_nfiles > NDFILE) - free(fdp->fd_ofiles, M_FILEDESC); + free(fdp->fd_ofiles, M_FILEDESC, 0); if (NDHISLOTS(nfiles) > NDHISLOTS(fdp->fd_nfiles)) { newhimap = malloc(NDHISLOTS(nfiles) * sizeof(u_int), @@ -800,8 +800,8 @@ fdexpand(struct proc *p) NDLOSLOTS(nfiles) * sizeof(u_int) - copylen); if (NDHISLOTS(fdp->fd_nfiles) > NDHISLOTS(NDFILE)) { - free(fdp->fd_himap, M_FILEDESC); - free(fdp->fd_lomap, M_FILEDESC); + free(fdp->fd_himap, M_FILEDESC, 0); + free(fdp->fd_lomap, M_FILEDESC, 0); } fdp->fd_himap = newhimap; fdp->fd_lomap = newlomap; @@ -1015,19 +1015,19 @@ fdfree(struct proc *p) } p->p_fd = NULL; if (fdp->fd_nfiles > NDFILE) - free(fdp->fd_ofiles, M_FILEDESC); + free(fdp->fd_ofiles, M_FILEDESC, 0); if (NDHISLOTS(fdp->fd_nfiles) > NDHISLOTS(NDFILE)) { - free(fdp->fd_himap, M_FILEDESC); - free(fdp->fd_lomap, M_FILEDESC); + free(fdp->fd_himap, M_FILEDESC, 0); + free(fdp->fd_lomap, M_FILEDESC, 0); } if (fdp->fd_cdir) vrele(fdp->fd_cdir); if (fdp->fd_rdir) vrele(fdp->fd_rdir); if (fdp->fd_knlist) - free(fdp->fd_knlist, M_TEMP); + free(fdp->fd_knlist, M_TEMP, 0); if (fdp->fd_knhash) - free(fdp->fd_knhash, M_TEMP); + free(fdp->fd_knhash, M_TEMP, 0); pool_put(&fdesc_pool, fdp); } diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 15cc3c50491..ce309cf6dc1 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.57 2014/05/15 04:43:25 guenther Exp $ */ +/* $OpenBSD: kern_event.c,v 1.58 2014/07/12 18:43:32 tedu Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -376,7 +376,7 @@ filt_timerdetach(struct knote *kn) to = (struct timeout *)kn->kn_hook; timeout_del(to); - free(to, M_KEVENT); + free(to, M_KEVENT, 0); kq_ntimeouts--; } @@ -1027,7 +1027,7 @@ knote_attach(struct knote *kn, struct filedesc *fdp) memset(&list[fdp->fd_knlistsize], 0, (size - fdp->fd_knlistsize) * sizeof(struct klist)); if (fdp->fd_knlist != NULL) - free(fdp->fd_knlist, M_TEMP); + free(fdp->fd_knlist, M_TEMP, 0); fdp->fd_knlistsize = size; fdp->fd_knlist = list; } diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 3031c65b9be..5751a840085 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.143 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.144 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -336,10 +336,10 @@ sys_execve(struct proc *p, void *v, register_t *retval) *dp++ = *cp++; *dp++ = '\0'; - free(*tmpfap, M_EXEC); + free(*tmpfap, M_EXEC, 0); tmpfap++; argc++; } - free(pack.ep_fa, M_EXEC); + free(pack.ep_fa, M_EXEC, 0); pack.ep_flags &= ~EXEC_HASARGL; } @@ -662,7 +662,7 @@ sys_execve(struct proc *p, void *v, register_t *retval) if (pr->ps_flags & PS_TRACED) psignal(p, SIGTRAP); - free(pack.ep_hdr, M_EXEC); + free(pack.ep_hdr, M_EXEC, 0); /* * Call emulation specific exec hook. This can setup per-process @@ -724,14 +724,14 @@ bad: if (pack.ep_interp != NULL) pool_put(&namei_pool, pack.ep_interp); if (pack.ep_emul_arg != NULL) - free(pack.ep_emul_arg, M_TEMP); + free(pack.ep_emul_arg, M_TEMP, 0); /* close and put the exec'd file */ vn_close(pack.ep_vp, FREAD, cred, p); pool_put(&namei_pool, nid.ni_cnd.cn_pnbuf); uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS); freehdr: - free(pack.ep_hdr, M_EXEC); + free(pack.ep_hdr, M_EXEC, 0); #if NSYSTRACE > 0 clrflag: #endif @@ -754,13 +754,13 @@ exec_abort: if (pack.ep_interp != NULL) pool_put(&namei_pool, pack.ep_interp); if (pack.ep_emul_arg != NULL) - free(pack.ep_emul_arg, M_TEMP); + free(pack.ep_emul_arg, M_TEMP, 0); pool_put(&namei_pool, nid.ni_cnd.cn_pnbuf); vn_close(pack.ep_vp, FREAD, cred, p); uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS); free_pack_abort: - free(pack.ep_hdr, M_EXEC); + free(pack.ep_hdr, M_EXEC, 0); exit1(p, W_EXITCODE(0, SIGABRT), EXIT_NORMAL); /* NOTREACHED */ diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 24d9305bb6e..e4955619a1e 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.146 2014/07/11 08:18:31 guenther Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.147 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -658,7 +658,7 @@ process_zap(struct process *pr) KASSERT(pr->ps_refcnt == 1); if (pr->ps_ptstat != NULL) - free(pr->ps_ptstat, M_SUBPROC); + free(pr->ps_ptstat, M_SUBPROC, 0); pool_put(&rusage_pool, pr->ps_ru); KASSERT(TAILQ_EMPTY(&pr->ps_threads)); limfree(pr->ps_limit); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 712288a2408..2e035f17ab2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.171 2014/07/11 08:20:42 guenther Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.172 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -493,7 +493,7 @@ fork1(struct proc *curp, int flags, void *stack, pid_t *tidptr, p->p_cpu = arg; if (newptstat) - free(newptstat, M_SUBPROC); + free(newptstat, M_SUBPROC, 0); /* * Notify any interested parties about the new process. diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index 8733f82cdb2..f70b0237799 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_kthread.c,v 1.35 2014/05/04 05:03:26 guenther Exp $ */ +/* $OpenBSD: kern_kthread.c,v 1.36 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_kthread.c,v 1.3 1998/12/22 21:21:36 kleink Exp $ */ /*- @@ -150,6 +150,6 @@ kthread_run_deferred_queue(void) while ((kq = SIMPLEQ_FIRST(&kthread_q)) != NULL) { SIMPLEQ_REMOVE_HEAD(&kthread_q, kq_q); (*kq->kq_func)(kq->kq_arg); - free(kq, M_TEMP); + free(kq, M_TEMP, 0); } } diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 5d308bcf694..71fb296cef6 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_ktrace.c,v 1.66 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_ktrace.c,v 1.67 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_ktrace.c,v 1.23 1996/02/09 18:59:36 christos Exp $ */ /* @@ -175,7 +175,7 @@ ktrsyscall(struct proc *p, register_t code, size_t argsize, register_t args[]) memset(argp, 0, nargs * sizeof(int)); kth.ktr_len = len; ktrwrite(p, &kth, ktp); - free(ktp, M_TEMP); + free(ktp, M_TEMP, 0); atomic_clearbits_int(&p->p_flag, P_INKTR); } @@ -284,7 +284,7 @@ ktrgenio(struct proc *p, int fd, enum uio_rw rw, struct iovec *iov, len -= count; } - free(ktp, M_TEMP); + free(ktp, M_TEMP, 0); atomic_clearbits_int(&p->p_flag, P_INKTR); } @@ -346,7 +346,7 @@ ktrstruct(struct proc *p, const char *name, const void *data, size_t datalen) kth.ktr_len = buflen; ktrwrite(p, &kth, buf); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); atomic_clearbits_int(&p->p_flag, P_INKTR); } @@ -387,7 +387,7 @@ ktruser(struct proc *p, const char *id, const void *addr, size_t len) ktrwrite(p, &kth, ktp); out: if (memp != NULL) - free(memp, M_TEMP); + free(memp, M_TEMP, 0); atomic_clearbits_int(&p->p_flag, P_INKTR); return (error); } diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index e19a5f7a876..a7a736b03dc 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lkm.c,v 1.47 2014/01/21 01:48:44 tedu Exp $ */ +/* $OpenBSD: kern_lkm.c,v 1.48 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_lkm.c,v 1.31 1996/03/31 21:40:27 christos Exp $ */ /* @@ -190,7 +190,7 @@ lkmfree(struct lkm_table *p) { TAILQ_REMOVE(&lkmods, p, list); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); curp = NULL; } diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 83936778a0d..496775f6697 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.112 2014/07/10 22:16:48 tedu Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.113 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -354,7 +354,7 @@ out: * Free a block of memory allocated by malloc. */ void -free(void *addr, int type) +free(void *addr, int type, size_t fauxsize) { struct kmembuckets *kbp; struct kmemusage *kup; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index df2d4e38ecf..6a81f16b6c7 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_proc.c,v 1.59 2014/07/04 05:58:30 guenther Exp $ */ +/* $OpenBSD: kern_proc.c,v 1.60 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */ /* @@ -124,7 +124,7 @@ uid_find(uid_t uid) if (uip->ui_uid == uid) break; if (uip) { - free(nuip, M_PROC); + free(nuip, M_PROC, 0); return (uip); } nuip->ui_uid = uid; diff --git a/sys/kern/kern_sensors.c b/sys/kern/kern_sensors.c index 2c8a40ed136..18453d15025 100644 --- a/sys/kern/kern_sensors.c +++ b/sys/kern/kern_sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sensors.c,v 1.27 2013/12/09 17:39:08 mikeb Exp $ */ +/* $OpenBSD: kern_sensors.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -248,7 +248,7 @@ sensor_task_work(void *xst, void *arg) rw_exit_write(&st->lock); if (period == 0) - free(st, M_DEVBUF); + free(st, M_DEVBUF, 0); else timeout_add_sec(&st->timeout, period); } diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 2e3bacb3100..f0f216bc190 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_subr.c,v 1.37 2013/10/19 09:24:57 reyk Exp $ */ +/* $OpenBSD: kern_subr.c,v 1.38 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_subr.c,v 1.15 1996/04/09 17:21:56 ragge Exp $ */ /* @@ -221,7 +221,7 @@ hook_disestablish(struct hook_desc_head *head, void *vhook) #endif hdp = vhook; TAILQ_REMOVE(head, hdp, hd_list); - free(hdp, M_DEVBUF); + free(hdp, M_DEVBUF, 0); } /* @@ -244,7 +244,7 @@ dohooks(struct hook_desc_head *head, int flags) TAILQ_REMOVE(head, hdp, hd_list); (*hdp->hd_fn)(hdp->hd_arg); if ((flags & HOOK_FREE) != 0) - free(hdp, M_DEVBUF); + free(hdp, M_DEVBUF, 0); } } } diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 3b3f3bc43a0..8c0310dd307 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.255 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.256 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1308,7 +1308,7 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, error = EINVAL; break; } - free(kf, M_TEMP); + free(kf, M_TEMP, 0); if (!error) { if (where == NULL) @@ -1471,7 +1471,7 @@ again: } err: if (kproc) - free(kproc, M_TEMP); + free(kproc, M_TEMP, 0); return (error); } @@ -1752,7 +1752,7 @@ more: out: uvmspace_free(vm); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (error); } @@ -1816,7 +1816,7 @@ sysctl_proc_cwd(int *name, u_int namelen, void *oldp, size_t *oldlenp, } vrele(vp); - free(path, M_TEMP); + free(path, M_TEMP, 0); return (error); } @@ -1849,9 +1849,9 @@ sysctl_diskinit(int update, struct proc *p) tlen++; if (disknames) - free(disknames, M_SYSCTL); + free(disknames, M_SYSCTL, 0); if (diskstats) - free(diskstats, M_SYSCTL); + free(diskstats, M_SYSCTL, 0); diskstats = NULL; disknames = NULL; diskstats = malloc(disk_count * sizeof(struct diskstats), @@ -2029,7 +2029,7 @@ sysctl_sysvipc(int *name, u_int namelen, void *where, size_t *sizep) } *sizep -= buflen; error = copyout(buf, where, *sizep); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); /* If copyout succeeded, use return code set earlier. */ return (error ? error : ret); } @@ -2074,7 +2074,7 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp, ret = sysctl_rdstruct(oldp, oldlenp, newp, usd, sizeof(struct sensordev)); - free(usd, M_TEMP); + free(usd, M_TEMP, 0); return (ret); } @@ -2097,7 +2097,7 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp, ret = sysctl_rdstruct(oldp, oldlenp, newp, us, sizeof(struct sensor)); - free(us, M_TEMP); + free(us, M_TEMP, 0); return (ret); } diff --git a/sys/kern/kern_task.c b/sys/kern/kern_task.c index 04592ad7f4e..b685ce888e2 100644 --- a/sys/kern/kern_task.c +++ b/sys/kern/kern_task.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_task.c,v 1.9 2014/06/11 08:47:53 blambert Exp $ */ +/* $OpenBSD: kern_task.c,v 1.10 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2013 David Gwynne <dlg@openbsd.org> @@ -129,7 +129,7 @@ taskq_destroy(struct taskq *tq) } mtx_leave(&tq->tq_mtx); - free(tq, M_DEVBUF); + free(tq, M_DEVBUF, 0); } void @@ -143,7 +143,7 @@ taskq_create_thread(void *arg) switch (tq->tq_state) { case TQ_S_DESTROYED: mtx_leave(&tq->tq_mtx); - free(tq, M_DEVBUF); + free(tq, M_DEVBUF, 0); return; case TQ_S_CREATED: diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 516bc2326a2..2b3b09c748f 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tc.c,v 1.24 2014/04/03 17:58:31 beck Exp $ */ +/* $OpenBSD: kern_tc.c,v 1.25 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -541,7 +541,7 @@ sysctl_tc_choice(void *oldp, size_t *oldlenp, void *newp, size_t newlen) strlcat(choices, buf, maxlen); } error = sysctl_rdstring(oldp, oldlenp, newp, choices); - free(choices, M_TEMP); + free(choices, M_TEMP, 0); return (error); } diff --git a/sys/kern/kern_workq.c b/sys/kern/kern_workq.c index df3762b80d0..a019620ab1c 100644 --- a/sys/kern/kern_workq.c +++ b/sys/kern/kern_workq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_workq.c,v 1.14 2013/11/26 20:33:19 deraadt Exp $ */ +/* $OpenBSD: kern_workq.c,v 1.15 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -116,7 +116,7 @@ workq_destroy(struct workq *wq) } mtx_leave(&wq->wq_mtx); - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); } int @@ -164,7 +164,7 @@ workq_create_thread(void *arg) switch (wq->wq_state) { case WQ_S_DESTROYED: mtx_leave(&wq->wq_mtx); - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); return; case WQ_S_CREATED: diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index b4021a46b17..f0994287b46 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_autoconf.c,v 1.76 2014/07/12 13:43:08 mpi Exp $ */ +/* $OpenBSD: subr_autoconf.c,v 1.77 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */ /* @@ -152,12 +152,12 @@ mapply(struct matchinfo *m, struct cfdata *cf) if (pri > m->pri) { if (m->indirect && m->match) - free(m->match, M_DEVBUF); + free(m->match, M_DEVBUF, 0); m->match = match; m->pri = pri; } else { if (m->indirect) - free(match, M_DEVBUF); + free(match, M_DEVBUF, 0); } } @@ -468,7 +468,7 @@ config_make_softc(struct device *parent, struct cfdata *cf) old != 0 ? "expand" : "creat"); if (old != 0) { bcopy(cd->cd_devs, nsp, old * sizeof(void *)); - free(cd->cd_devs, M_DEVBUF); + free(cd->cd_devs, M_DEVBUF, 0); } cd->cd_devs = nsp; } @@ -610,7 +610,7 @@ config_detach(struct device *dev, int flags) if (cd->cd_devs[i] != NULL) break; if (i == cd->cd_ndevs) { /* nothing found; deallocate */ - free(cd->cd_devs, M_DEVBUF); + free(cd->cd_devs, M_DEVBUF, 0); cd->cd_devs = NULL; cd->cd_ndevs = 0; cf->cf_unit = 0; @@ -689,7 +689,7 @@ config_process_deferred_children(struct device *parent) if (dc->dc_dev->dv_parent == parent) { TAILQ_REMOVE(&deferred_config_queue, dc, dc_queue); (*dc->dc_func)(dc->dc_dev); - free(dc, M_DEVBUF); + free(dc, M_DEVBUF, 0); config_pending_decr(); } } @@ -888,6 +888,6 @@ device_unref(struct device *dv) { dv->dv_ref--; if (dv->dv_ref == 0) { - free(dv, M_DEVBUF); + free(dv, M_DEVBUF, 0); } } diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 5979a3ff4be..95fc03e0e91 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.166 2014/07/12 17:50:36 jsing Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.167 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -816,7 +816,7 @@ disk_detach(struct disk *diskp) /* * Free the space used by the disklabel structures. */ - free(diskp->dk_label, M_DEVBUF); + free(diskp->dk_label, M_DEVBUF, 0); /* * Remove from the disklist. diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c index f5f29cb1cbd..52e130e891f 100644 --- a/sys/kern/subr_extent.c +++ b/sys/kern/subr_extent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_extent.c,v 1.50 2014/01/21 21:45:58 kettenis Exp $ */ +/* $OpenBSD: subr_extent.c,v 1.51 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */ /*- @@ -236,7 +236,7 @@ extent_create(char *name, u_long start, u_long end, int mtype, caddr_t storage, rp = extent_alloc_region_descriptor(ex, flags); if (rp == NULL) { if (!fixed_extent) - free(ex, mtype); + free(ex, mtype, 0); return (NULL); } rp->er_start = start; @@ -280,7 +280,7 @@ extent_destroy(struct extent *ex) /* If we're not a fixed extent, free the extent descriptor itself. */ if ((ex->ex_flags & EXF_FIXED) == 0) - free(ex, ex->ex_mtype); + free(ex, ex->ex_mtype, 0); } /* diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index a0b455d305c..b64872a82d8 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_log.c,v 1.20 2014/07/10 08:55:35 deraadt Exp $ */ +/* $OpenBSD: subr_log.c,v 1.21 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */ /* @@ -380,7 +380,7 @@ sys_sendsyslog(struct proc *p, void *v, register_t *retval) if (ktriov != NULL) { if (error == 0) ktrgenio(p, 0, UIO_WRITE, ktriov, aiov.iov_len); - free(ktriov, M_TEMP); + free(ktriov, M_TEMP, 0); } #endif FRELE(f, p); diff --git a/sys/kern/subr_userconf.c b/sys/kern/subr_userconf.c index eeb530f4e12..1ff26b477da 100644 --- a/sys/kern/subr_userconf.c +++ b/sys/kern/subr_userconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_userconf.c,v 1.39 2014/01/21 01:48:44 tedu Exp $ */ +/* $OpenBSD: subr_userconf.c,v 1.40 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 1996-2001 Mats O Jansson <moj@stacken.kth.se> @@ -510,7 +510,7 @@ userconf_change(int devno) if (memcmp(cd->cf_loc, lk, sizeof(int) * i)) cd->cf_loc = lk; else - free(lk, M_TEMP); + free(lk, M_TEMP, 0); } printf("%3d ", devno); diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 837d95f8182..b94b7dd4f8f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.88 2014/07/08 17:42:50 miod Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.89 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -212,13 +212,13 @@ dofilereadv(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, if (ktriov != NULL) { if (error == 0) ktrgenio(p, fd, UIO_READ, ktriov, cnt); - free(ktriov, M_TEMP); + free(ktriov, M_TEMP, 0); } #endif *retval = cnt; done: if (needfree) - free(needfree, M_IOV); + free(needfree, M_IOV, 0); out: FRELE(fp, p); return (error); @@ -368,13 +368,13 @@ dofilewritev(struct proc *p, int fd, struct file *fp, const struct iovec *iovp, if (ktriov != NULL) { if (error == 0) ktrgenio(p, fd, UIO_WRITE, ktriov, cnt); - free(ktriov, M_TEMP); + free(ktriov, M_TEMP, 0); } #endif *retval = cnt; done: if (needfree) - free(needfree, M_IOV); + free(needfree, M_IOV, 0); out: FRELE(fp, p); return (error); @@ -518,7 +518,7 @@ sys_ioctl(struct proc *p, void *v, register_t *retval) out: FRELE(fp, p); if (memp) - free(memp, M_IOCTLOPS); + free(memp, M_IOCTLOPS, 0); return (error); } @@ -714,7 +714,7 @@ done: } if (pibits[0] != (fd_set *)&bits[0]) - free(pibits[0], M_TEMP); + free(pibits[0], M_TEMP, 0); return (error); } @@ -1015,7 +1015,7 @@ done: } bad: if (pl != pfds) - free(pl, M_TEMP); + free(pl, M_TEMP, 0); return (error); } diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 56cf0e0ea19..53d7efec5ad 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_process.c,v 1.62 2014/07/11 08:18:31 guenther Exp $ */ +/* $OpenBSD: sys_process.c,v 1.63 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */ /*- @@ -581,7 +581,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) { error = process_write_regs(t, regs); } - free(regs, M_TEMP); + free(regs, M_TEMP, 0); return (error); case PT_GETREGS: KASSERT((p->p_flag & P_SYSTEM) == 0); @@ -593,7 +593,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) error = copyout(regs, SCARG(uap, addr), sizeof (*regs)); - free(regs, M_TEMP); + free(regs, M_TEMP, 0); return (error); #ifdef PT_SETFPREGS case PT_SETFPREGS: @@ -606,7 +606,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) { error = process_write_fpregs(t, fpregs); } - free(fpregs, M_TEMP); + free(fpregs, M_TEMP, 0); return (error); #endif #ifdef PT_GETFPREGS @@ -620,7 +620,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) error = copyout(fpregs, SCARG(uap, addr), sizeof(*fpregs)); - free(fpregs, M_TEMP); + free(fpregs, M_TEMP, 0); return (error); #endif #ifdef PT_SETXMMREGS @@ -634,7 +634,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) { error = process_write_xmmregs(t, xmmregs); } - free(xmmregs, M_TEMP); + free(xmmregs, M_TEMP, 0); return (error); #endif #ifdef PT_GETXMMREGS @@ -648,7 +648,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval) if (error == 0) error = copyout(xmmregs, SCARG(uap, addr), sizeof(*xmmregs)); - free(xmmregs, M_TEMP); + free(xmmregs, M_TEMP, 0); return (error); #endif #ifdef PT_WCOOKIE diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 3c2ed063724..7a2760b7104 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_msg.c,v 1.27 2014/03/18 06:59:00 guenther Exp $ */ +/* $OpenBSD: sysv_msg.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: sysv_msg.c,v 1.19 1996/02/09 19:00:18 christos Exp $ */ /* * Copyright (c) 2009 Bret S. Lambert <blambert@openbsd.org> @@ -393,7 +393,7 @@ que_create(key_t key, struct ucred *cred, int mode) /* if malloc slept, a queue with the same key may have been created */ if (que_key_lookup(key)) { - free(que, M_TEMP); + free(que, M_TEMP, 0); return (NULL); } @@ -488,7 +488,7 @@ que_free(struct que *que) TAILQ_REMOVE(&que->que_msgs, msg, msg_next); msg_free(msg); } - free(que, M_TEMP); + free(que, M_TEMP, 0); num_ques--; } @@ -699,7 +699,7 @@ sysctl_sysvmsg(int *name, u_int namelen, void *where, size_t *sizep) msginfo.msgmni * sizeof(struct msqid_ds); if (*sizep < infolen) { - free(info, M_TEMP); + free(info, M_TEMP, 0); return (ENOMEM); } @@ -716,7 +716,7 @@ sysctl_sysvmsg(int *name, u_int namelen, void *where, size_t *sizep) error = copyout(info, where, infolen); - free(info, M_TEMP); + free(info, M_TEMP, 0); return (error); diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index b5b8e1e515b..df3ddd3650a 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_sem.c,v 1.46 2014/03/18 06:59:00 guenther Exp $ */ +/* $OpenBSD: sysv_sem.c,v 1.47 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */ /* @@ -277,7 +277,7 @@ semctl1(struct proc *p, int semid, int semnum, int cmd, union semun *arg, semaptr->sem_perm.cuid = cred->cr_uid; semaptr->sem_perm.uid = cred->cr_uid; semtot -= semaptr->sem_nsems; - free(semaptr->sem_base, M_SEM); + free(semaptr->sem_base, M_SEM, 0); pool_put(&sema_pool, semaptr); sema[ix] = NULL; semundo_clear(ix, -1); @@ -384,7 +384,7 @@ semctl1(struct proc *p, int semid, int semnum, int cmd, union semun *arg, error: if (semval) - free(semval, M_TEMP); + free(semval, M_TEMP, 0); return (error); } @@ -446,7 +446,7 @@ sys_semget(struct proc *p, void *v, register_t *retval) goto error; } if (semaptr_new != NULL) { - free(semaptr_new->sem_base, M_SEM); + free(semaptr_new->sem_base, M_SEM, 0); pool_put(&sema_pool, semaptr_new); } goto found; @@ -489,7 +489,7 @@ found: return (0); error: if (semaptr_new != NULL) { - free(semaptr_new->sem_base, M_SEM); + free(semaptr_new->sem_base, M_SEM, 0); pool_put(&sema_pool, semaptr_new); } return (error); @@ -753,7 +753,7 @@ done: *retval = 0; done2: if (sops != sopbuf) - free(sops, M_SEM); + free(sops, M_SEM, 0); return (error); } @@ -881,8 +881,8 @@ sysctl_sysvsem(int *name, u_int namelen, void *oldp, size_t *oldlenp, M_WAITOK|M_ZERO); bcopy(semseqs, newseqs, seminfo.semmni * sizeof(unsigned short)); - free(sema, M_SEM); - free(semseqs, M_SEM); + free(sema, M_SEM, 0); + free(semseqs, M_SEM, 0); sema = sema_new; semseqs = newseqs; seminfo.semmni = val; diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index f850629e9a0..c9ea3b5f3f7 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.56 2014/03/18 06:59:00 guenther Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.57 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: sysv_shm.c,v 1.50 1998/10/21 22:24:29 tron Exp $ */ /* @@ -517,7 +517,7 @@ shmexit(struct vmspace *vm) i++, shmmap_s++) if (shmmap_s->shmid != -1) shm_delete_mapping(vm, shmmap_s); - free(vm->vm_shm, M_SHM); + free(vm->vm_shm, M_SHM, 0); vm->vm_shm = NULL; } @@ -596,13 +596,13 @@ sysctl_sysvshm(int *name, u_int namelen, void *oldp, size_t *oldlenp, M_SHM, M_WAITOK|M_ZERO); bcopy(shmsegs, newsegs, shminfo.shmmni * sizeof(struct shmid_ds *)); - free(shmsegs, M_SHM); + free(shmsegs, M_SHM, 0); shmsegs = newsegs; newseqs = malloc(val * sizeof(unsigned short), M_SHM, M_WAITOK|M_ZERO); bcopy(shmseqs, newseqs, shminfo.shmmni * sizeof(unsigned short)); - free(shmseqs, M_SHM); + free(shmseqs, M_SHM, 0); shmseqs = newseqs; shminfo.shmmni = val; return (0); diff --git a/sys/kern/tty.c b/sys/kern/tty.c index b41e9bdcdda..2fb04ad11aa 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.110 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: tty.c,v 1.111 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -1641,7 +1641,7 @@ read: out: if (stime) { timeout_del(stime); - free(stime, M_TEMP); + free(stime, M_TEMP, 0); } return (error); } @@ -2358,7 +2358,7 @@ ttyfree(struct tty *tp) clfree(&tp->t_rawq); clfree(&tp->t_canq); clfree(&tp->t_outq); - free(tp, M_TTYS); + free(tp, M_TTYS, 0); } void @@ -2416,7 +2416,7 @@ sysctl_tty(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, ttystats_init(&ttystats); err = sysctl_rdstruct(oldp, oldlenp, newp, ttystats, tty_count * sizeof(struct itty)); - free(ttystats, M_SYSCTL); + free(ttystats, M_SYSCTL, 0); return (err); } default: diff --git a/sys/kern/tty_endrun.c b/sys/kern/tty_endrun.c index 9cba2d53550..a7d35401961 100644 --- a/sys/kern/tty_endrun.c +++ b/sys/kern/tty_endrun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_endrun.c,v 1.3 2010/04/12 12:57:52 tedu Exp $ */ +/* $OpenBSD: tty_endrun.c,v 1.4 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org> @@ -155,7 +155,7 @@ endrunopen(dev_t dev, struct tty *tp, struct proc *p) error = linesw[TTYDISC].l_open(dev, tp, p); if (error) { - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; } else { sensordev_install(&np->timedev); @@ -174,7 +174,7 @@ endrunclose(struct tty *tp, int flags, struct proc *p) tp->t_line = TTYDISC; /* switch back to termios */ timeout_del(&np->endrun_tout); sensordev_deinstall(&np->timedev); - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; endrun_count--; if (endrun_count == 0) diff --git a/sys/kern/tty_msts.c b/sys/kern/tty_msts.c index 00b2566572c..e87c1971507 100644 --- a/sys/kern/tty_msts.c +++ b/sys/kern/tty_msts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_msts.c,v 1.16 2010/04/12 12:57:52 tedu Exp $ */ +/* $OpenBSD: tty_msts.c,v 1.17 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org> @@ -117,7 +117,7 @@ mstsopen(dev_t dev, struct tty *tp, struct proc *p) error = linesw[TTYDISC].l_open(dev, tp, p); if (error) { - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; } else { sensordev_install(&np->timedev); @@ -135,7 +135,7 @@ mstsclose(struct tty *tp, int flags, struct proc *p) tp->t_line = TTYDISC; /* switch back to termios */ timeout_del(&np->msts_tout); sensordev_deinstall(&np->timedev); - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; msts_count--; if (msts_count == 0) diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c index 4b0c84926f8..9bf5c4ca05f 100644 --- a/sys/kern/tty_nmea.c +++ b/sys/kern/tty_nmea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_nmea.c,v 1.41 2014/03/21 21:54:14 andre Exp $ */ +/* $OpenBSD: tty_nmea.c,v 1.42 2014/07/12 18:43:32 tedu Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org> @@ -135,7 +135,7 @@ nmeaopen(dev_t dev, struct tty *tp, struct proc *p) error = linesw[TTYDISC].l_open(dev, tp, p); if (error) { - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; } else { sensordev_install(&np->timedev); @@ -152,7 +152,7 @@ nmeaclose(struct tty *tp, int flags, struct proc *p) tp->t_line = TTYDISC; /* switch back to termios */ timeout_del(&np->nmea_tout); sensordev_deinstall(&np->timedev); - free(np, M_DEVBUF); + free(np, M_DEVBUF, 0); tp->t_sc = NULL; nmea_count--; if (nmea_count == 0) diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 94c10c0dc7b..cddbad83923 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.66 2014/07/09 15:46:22 tedu Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.67 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -182,7 +182,7 @@ check_pty(int minor) newpt = ptyarralloc(newnpty); memcpy(newpt, pt_softc, npty * sizeof(struct pt_softc *)); - free(pt_softc, M_DEVBUF); + free(pt_softc, M_DEVBUF, 0); pt_softc = newpt; npty = newnpty; } diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index aa8c39a6a3e..34e0329431b 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.27 2014/07/09 15:46:22 tedu Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.28 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -73,11 +73,11 @@ clfree(struct clist *clp) { if (clp->c_cs) { explicit_bzero(clp->c_cs, clp->c_cn); - free(clp->c_cs, M_TTYS); + free(clp->c_cs, M_TTYS, 0); } if (clp->c_cq) { explicit_bzero(clp->c_cq, QMEM(clp->c_cn)); - free(clp->c_cq, M_TTYS); + free(clp->c_cq, M_TTYS, 0); } clp->c_cs = clp->c_cq = NULL; } diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 5ff3bef35a1..147dcb789b9 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.89 2013/09/14 02:28:02 guenther Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.90 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -454,7 +454,7 @@ sys_sendmsg(struct proc *p, void *v, register_t *retval) error = sendit(p, SCARG(uap, s), &msg, SCARG(uap, flags), retval); done: if (iov != aiov) - free(iov, M_IOV); + free(iov, M_IOV, 0); return (error); } @@ -539,7 +539,7 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) if (ktriov != NULL) { if (error == 0) ktrgenio(p, s, UIO_WRITE, ktriov, *retsize); - free(ktriov, M_TEMP); + free(ktriov, M_TEMP, 0); } #endif bad: @@ -619,7 +619,7 @@ sys_recvmsg(struct proc *p, void *v, register_t *retval) } done: if (iov != aiov) - free(iov, M_IOV); + free(iov, M_IOV, 0); return (error); } @@ -678,7 +678,7 @@ recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp, if (ktriov != NULL) { if (error == 0) ktrgenio(p, s, UIO_READ, ktriov, len - auio.uio_resid); - free(ktriov, M_TEMP); + free(ktriov, M_TEMP, 0); } #endif if (error) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index cea89f690ca..a3f6e59a8b5 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.73 2014/03/18 06:59:00 guenther Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.74 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -394,10 +394,10 @@ unp_detach(struct unpcb *unp) * gets them (resulting in a "panic: closef: count < 0"). */ sorflush(unp->unp_socket); - free(unp, M_PCB); + free(unp, M_PCB, 0); unp_gc(); } else - free(unp, M_PCB); + free(unp, M_PCB, 0); } int @@ -636,7 +636,7 @@ unp_drop(struct unpcb *unp, int errno) so->so_pcb = NULL; sofree(so); m_freem(unp->unp_addr); - free(unp, M_PCB); + free(unp, M_PCB, 0); } } @@ -767,7 +767,7 @@ restart: out: fdpunlock(p->p_fd); if (fdp) - free(fdp, M_TEMP); + free(fdp, M_TEMP, 0); return (error); } @@ -810,14 +810,14 @@ morespace: /* allocate a cluster and try again */ MCLGET(control, M_WAIT); if ((control->m_flags & M_EXT) == 0) { - free(tmp, M_TEMP); + free(tmp, M_TEMP, 0); return (ENOBUFS); /* allocation failed */ } /* copy the data back into the cluster */ cm = mtod(control, struct cmsghdr *); memcpy(cm, tmp, control->m_len); - free(tmp, M_TEMP); + free(tmp, M_TEMP, 0); goto morespace; } @@ -980,7 +980,7 @@ unp_gc(void) sorflush((*fpp)->f_data); for (i = nunref, fpp = extra_ref; --i >= 0; ++fpp) (void) closef(*fpp, NULL); - free(extra_ref, M_FILE); + free(extra_ref, M_FILE, 0); unp_gcing = 0; } diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index bab53313460..16c1fc136ed 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.157 2014/07/11 03:06:08 mlarkin Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.158 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /* @@ -408,7 +408,7 @@ bread_cluster_callback(struct buf *bp) biodone(xbpp[i]); } - free(xbpp, M_TEMP); + free(xbpp, M_TEMP, 0); if (ISSET(bp->b_flags, B_ASYNC)) { brelse(bp); @@ -460,7 +460,7 @@ bread_cluster(struct vnode *vp, daddr_t blkno, int size, struct buf **rbpp) SET(xbpp[i]->b_flags, B_INVAL); brelse(xbpp[i]); } - free(xbpp, M_TEMP); + free(xbpp, M_TEMP, 0); goto out; } } diff --git a/sys/kern/vfs_cluster.c b/sys/kern/vfs_cluster.c index c78fd3b1ed0..89d84c67696 100644 --- a/sys/kern/vfs_cluster.c +++ b/sys/kern/vfs_cluster.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_cluster.c,v 1.41 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: vfs_cluster.c,v 1.42 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_cluster.c,v 1.12 1996/04/22 01:39:05 christos Exp $ */ /* @@ -102,7 +102,7 @@ cluster_write(struct buf *bp, struct cluster_info *ci, u_quad_t filesize) for (bpp = buflist->bs_children; bpp < endbp; bpp++) brelse(*bpp); - free(buflist, M_VCLUSTER); + free(buflist, M_VCLUSTER, 0); cluster_wbuild(vp, NULL, bp->b_bcount, ci->ci_cstart, cursize, lbn); } else { @@ -112,7 +112,7 @@ cluster_write(struct buf *bp, struct cluster_info *ci, u_quad_t filesize) for (bpp = buflist->bs_children; bpp <= endbp; bpp++) bdwrite(*bpp); - free(buflist, M_VCLUSTER); + free(buflist, M_VCLUSTER, 0); ci->ci_lastw = lbn; ci->ci_lasta = bp->b_blkno; return; diff --git a/sys/kern/vfs_getcwd.c b/sys/kern/vfs_getcwd.c index 93231074fe2..8421c4689be 100644 --- a/sys/kern/vfs_getcwd.c +++ b/sys/kern/vfs_getcwd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_getcwd.c,v 1.21 2013/08/13 05:52:24 guenther Exp $ */ +/* $OpenBSD: vfs_getcwd.c,v 1.22 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ /* @@ -192,7 +192,7 @@ out: vrele(lvp); *lvpp = NULL; - free(dirbuf, M_TEMP); + free(dirbuf, M_TEMP, 0); return (error); } @@ -420,7 +420,7 @@ sys___getcwd(struct proc *p, void *v, register_t *retval) error = copyout(bp, SCARG(uap, buf), lenused); out: - free(path, M_TEMP); + free(path, M_TEMP, 0); return (error); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 120ca5bec3c..b97b497f821 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.216 2014/07/10 12:21:08 mpi Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.217 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -1066,7 +1066,7 @@ vgonel(struct vnode *vp, struct proc *p) vx->v_flag &= ~VALIASED; vp->v_flag &= ~VALIASED; } - free(vp->v_specinfo, M_VNODE); + free(vp->v_specinfo, M_VNODE, 0); vp->v_specinfo = NULL; } /* @@ -1281,7 +1281,7 @@ vfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, ret = sysctl_rdstruct(oldp, oldlenp, newp, tmpvfsp, sizeof(struct vfsconf)); - free(tmpvfsp, M_TEMP); + free(tmpvfsp, M_TEMP, 0); return (ret); case VFS_BCACHESTAT: /* buffer cache statistics */ ret = sysctl_rdstruct(oldp, oldlenp, newp, &bcstats, @@ -1449,7 +1449,7 @@ finish: crfromxucred(&np->netc_anon, &argp->ex_anon); return (0); out: - free(np, M_NETADDR); + free(np, M_NETADDR, 0); return (error); } @@ -1460,7 +1460,7 @@ vfs_free_netcred(struct radix_node *rn, void *w, u_int id) struct radix_node_head *rnh = (struct radix_node_head *)w; (*rnh->rnh_deladdr)(rn->rn_key, rn->rn_mask, rnh, NULL); - free(rn, M_NETADDR); + free(rn, M_NETADDR, 0); return (0); } @@ -1474,7 +1474,7 @@ vfs_free_addrlist(struct netexport *nep) if ((rnh = nep->ne_rtable_inet) != NULL) { (*rnh->rnh_walktree)(rnh, vfs_free_netcred, rnh); - free(rnh, M_RTABLE); + free(rnh, M_RTABLE, 0); nep->ne_rtable_inet = NULL; } } diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 7fb1adebd27..11d1afba894 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.207 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.208 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -304,7 +304,7 @@ update: } else { mp->mnt_vnodecovered->v_mountedhere = NULL; vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); vput(vp); } return (error); @@ -454,7 +454,7 @@ dounmount(struct mount *mp, int flags, struct proc *p, struct vnode *olddp) panic("unmount: dangling vnode"); vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); return (0); } diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8971904785a..0ea3035563a 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_vnops.c,v 1.76 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: vfs_vnops.c,v 1.77 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */ /* @@ -173,7 +173,7 @@ vn_open(struct nameidata *ndp, int fmode, int cmode) VOP_UNLOCK(vp, 0, p); /* keep a reference */ vp = ndp->ni_vp; /* for the increment below */ - free(cip, M_TEMP); + free(cip, M_TEMP, 0); } if (fmode & FWRITE) diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index c6995b89379..d083f71d0bf 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.39 2013/03/28 03:29:44 guenther Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.40 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -128,14 +128,14 @@ fifo_open(void *v) fip = malloc(sizeof(*fip), M_VNODE, M_WAITOK); vp->v_fifoinfo = fip; if ((error = socreate(AF_LOCAL, &rso, SOCK_STREAM, 0)) != 0) { - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; return (error); } fip->fi_readsock = rso; if ((error = socreate(AF_LOCAL, &wso, SOCK_STREAM, 0)) != 0) { (void)soclose(rso); - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; return (error); } @@ -143,7 +143,7 @@ fifo_open(void *v) if ((error = unp_connect2(wso, rso)) != 0) { (void)soclose(wso); (void)soclose(rso); - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; return (error); } @@ -351,7 +351,7 @@ fifo_close(void *v) if (fip->fi_readers == 0 && fip->fi_writers == 0) { error1 = soclose(fip->fi_readsock); error2 = soclose(fip->fi_writesock); - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; } return (error1 ? error1 : error2); @@ -369,7 +369,7 @@ fifo_reclaim(void *v) soclose(fip->fi_readsock); soclose(fip->fi_writesock); - free(fip, M_VNODE); + free(fip, M_VNODE, 0); vp->v_fifoinfo = NULL; return (0); diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c index 5df831229d0..567985f6777 100644 --- a/sys/miscfs/fuse/fuse_device.c +++ b/sys/miscfs/fuse/fuse_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_device.c,v 1.14 2014/03/18 08:51:53 mpi Exp $ */ +/* $OpenBSD: fuse_device.c,v 1.15 2014/07/12 18:43:52 tedu Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -148,7 +148,7 @@ fuse_destroy(dev_t dev, struct fuse_d *fd) { LIST_REMOVE(fd, fd_list); fuse_device_cleanup(dev, NULL); - free(fd, M_DEVBUF); + free(fd, M_DEVBUF, 0); } /* @@ -339,7 +339,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) #endif /* Adding fbuf in fd_fbufs_wait */ - free(fbuf->fb_dat, M_FUSEFS); + free(fbuf->fb_dat, M_FUSEFS, 0); fbuf->fb_dat = NULL; SIMPLEQ_INSERT_TAIL(&fd->fd_fbufs_wait, fbuf, fb_next); stat_fbufs_wait++; @@ -374,7 +374,7 @@ fuseioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) ioexch->fbxch_len); if (error) { printf("fuse: Cannot copyin\n"); - free(fbuf->fb_dat, M_FUSEFS); + free(fbuf->fb_dat, M_FUSEFS, 0); fbuf->fb_dat = NULL; return (error); } diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index f35296f69b3..0ecb4002da2 100644 --- a/sys/miscfs/fuse/fuse_vfsops.c +++ b/sys/miscfs/fuse/fuse_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vfsops.c,v 1.10 2014/06/04 18:52:53 syl Exp $ */ +/* $OpenBSD: fuse_vfsops.c,v 1.11 2014/07/12 18:43:52 tedu Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -163,7 +163,7 @@ fusefs_unmount(struct mount *mp, int mntflags, struct proc *p) fuse_device_cleanup(fmp->dev, NULL); fuse_device_set_fmp(fmp, 0); - free(fmp, M_FUSEFS); + free(fmp, M_FUSEFS, 0); return (error); } diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c index 1b6612fe3bf..6d6c20d5c5e 100644 --- a/sys/miscfs/fuse/fuse_vnops.c +++ b/sys/miscfs/fuse/fuse_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vnops.c,v 1.18 2014/05/20 13:32:22 syl Exp $ */ +/* $OpenBSD: fuse_vnops.c,v 1.19 2014/07/12 18:43:52 tedu Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -825,7 +825,7 @@ fusefs_reclaim(void *v) ufs_ihashrem(&ip->ufs_ino); cache_purge(vp); - free(ip, M_FUSEFS); + free(ip, M_FUSEFS, 0); vp->v_data = NULL; return (0); } diff --git a/sys/miscfs/fuse/fusebuf.c b/sys/miscfs/fuse/fusebuf.c index 790d9b4862f..8d00f26f7d9 100644 --- a/sys/miscfs/fuse/fusebuf.c +++ b/sys/miscfs/fuse/fusebuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fusebuf.c,v 1.6 2013/10/07 18:15:21 syl Exp $ */ +/* $OpenBSD: fusebuf.c,v 1.7 2014/07/12 18:43:52 tedu Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -70,7 +70,7 @@ void fb_delete(struct fusebuf *fbuf) { if (fbuf != NULL) { - free(fbuf->fb_dat, M_FUSEFS); + free(fbuf->fb_dat, M_FUSEFS, 0); pool_put(&fusefs_fbuf_pool, fbuf); } } diff --git a/sys/miscfs/procfs/procfs_cmdline.c b/sys/miscfs/procfs/procfs_cmdline.c index 3fc4d784bc0..ccfed62ebc3 100644 --- a/sys/miscfs/procfs/procfs_cmdline.c +++ b/sys/miscfs/procfs/procfs_cmdline.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_cmdline.c,v 1.12 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: procfs_cmdline.c,v 1.13 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: procfs_cmdline.c,v 1.3 1999/03/13 22:26:48 thorpej Exp $ */ /* @@ -85,7 +85,7 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct else error = uiomove(arg, len - uio->uio_offset, uio); - free(arg, M_TEMP); + free(arg, M_TEMP, 0); return (error); } @@ -100,7 +100,7 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct */ /* XXXCDC: how should locking work here? */ if ((pr->ps_flags & PS_EXITING) || (pr->ps_vmspace->vm_refcnt < 1)) { - free(arg, M_TEMP); + free(arg, M_TEMP, 0); return (EFAULT); } vm = pr->ps_vmspace; @@ -181,6 +181,6 @@ procfs_docmdline(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct bad: uvmspace_free(vm); - free(arg, M_TEMP); + free(arg, M_TEMP, 0); return (error); } diff --git a/sys/miscfs/procfs/procfs_status.c b/sys/miscfs/procfs/procfs_status.c index a077558f7fe..3596141ee8d 100644 --- a/sys/miscfs/procfs/procfs_status.c +++ b/sys/miscfs/procfs/procfs_status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_status.c,v 1.15 2013/10/01 20:15:56 sf Exp $ */ +/* $OpenBSD: procfs_status.c,v 1.16 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: procfs_status.c,v 1.11 1996/03/16 23:52:50 christos Exp $ */ /* @@ -167,6 +167,6 @@ procfs_dostatus(struct proc *curp, struct proc *p, struct pfsnode *pfs, struct u error = uiomove(ps + uio->uio_offset, len, uio); } - free(ps, M_TEMP); + free(ps, M_TEMP, 0); return (error); } diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index d69e534bbb8..b6b616cf144 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_subr.c,v 1.35 2011/12/24 04:34:20 guenther Exp $ */ +/* $OpenBSD: procfs_subr.c,v 1.36 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */ /* @@ -184,7 +184,7 @@ procfs_freevp(struct vnode *vp) struct pfsnode *pfs = VTOPFS(vp); TAILQ_REMOVE(&pfshead, pfs, list); - free(vp->v_data, M_TEMP); + free(vp->v_data, M_TEMP, 0); vp->v_data = 0; return (0); } diff --git a/sys/miscfs/procfs/procfs_vfsops.c b/sys/miscfs/procfs/procfs_vfsops.c index ec082c66a21..adeb9b1edeb 100644 --- a/sys/miscfs/procfs/procfs_vfsops.c +++ b/sys/miscfs/procfs/procfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_vfsops.c,v 1.31 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: procfs_vfsops.c,v 1.32 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: procfs_vfsops.c,v 1.25 1996/02/09 22:40:53 christos Exp $ */ /* @@ -134,7 +134,7 @@ procfs_unmount(struct mount *mp, int mntflags, struct proc *p) if ((error = vflush(mp, 0, flags)) != 0) return (error); - free(VFSTOPROC(mp), M_MISCFSMNT); + free(VFSTOPROC(mp), M_MISCFSMNT, 0); mp->mnt_data = 0; return (0); diff --git a/sys/net/bpf.c b/sys/net/bpf.c index a8bbb5ac386..e3a7f96fdc3 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.102 2014/07/12 11:27:45 henning Exp $ */ +/* $OpenBSD: bpf.c,v 1.103 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -913,7 +913,7 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, int wf) d->bd_rfilter = NULL; bpf_reset_d(d); splx(s); - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); return (0); } flen = fp->bf_len; @@ -931,11 +931,11 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp, int wf) d->bd_rfilter = fcode; bpf_reset_d(d); splx(s); - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); return (0); } - free(fcode, M_DEVBUF); + free(fcode, M_DEVBUF, 0); return (EINVAL); } @@ -1455,11 +1455,11 @@ bpf_freed(struct bpf_d *d) if (--d->bd_ref > 0) return; - free(d->bd_sbuf, M_DEVBUF); - free(d->bd_hbuf, M_DEVBUF); - free(d->bd_fbuf, M_DEVBUF); - free(d->bd_rfilter, M_DEVBUF); - free(d->bd_wfilter, M_DEVBUF); + free(d->bd_sbuf, M_DEVBUF, 0); + free(d->bd_hbuf, M_DEVBUF, 0); + free(d->bd_fbuf, M_DEVBUF, 0); + free(d->bd_rfilter, M_DEVBUF, 0); + free(d->bd_wfilter, M_DEVBUF, 0); bpfilter_destroy(d); } @@ -1528,7 +1528,7 @@ bpfdetach(struct ifnet *ifp) } } - free(bp, M_DEVBUF); + free(bp, M_DEVBUF, 0); } else pbp = &bp->bif_next; } @@ -1599,7 +1599,7 @@ void bpfilter_destroy(struct bpf_d *bd) { LIST_REMOVE(bd, bd_list); - free(bd, M_DEVBUF); + free(bd, M_DEVBUF, 0); } /* diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 3217eb8cb5d..20312766543 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bridgestp.c,v 1.47 2014/04/19 15:54:39 henning Exp $ */ +/* $OpenBSD: bridgestp.c,v 1.48 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -1957,7 +1957,7 @@ bstp_destroy(struct bstp_state *bs) if (!LIST_EMPTY(&bs->bs_bplist)) panic("bstp still active"); - free(bs, M_DEVBUF); + free(bs, M_DEVBUF, 0); } void @@ -2033,7 +2033,7 @@ bstp_delete(struct bstp_port *bp) LIST_REMOVE(bp, bp_next); bp->bp_bs = NULL; bp->bp_active = 0; - free(bp, M_DEVBUF); + free(bp, M_DEVBUF, 0); bstp_initialization(bs); } diff --git a/sys/net/bsd-comp.c b/sys/net/bsd-comp.c index 84190e5057a..21055eb59cd 100644 --- a/sys/net/bsd-comp.c +++ b/sys/net/bsd-comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd-comp.c,v 1.7 2007/09/15 16:43:51 henning Exp $ */ +/* $OpenBSD: bsd-comp.c,v 1.8 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: bsd-comp.c,v 1.6 1996/10/13 02:10:58 christos Exp $ */ /* Because this code is derived from the 4.3BSD compress source: @@ -356,7 +356,7 @@ bsd_alloc(options, opt_len, decomp) db->lens = malloc((maxmaxcode+1) * sizeof(db->lens[0]), M_DEVBUF, M_NOWAIT); if (!db->lens) { - free(db, M_DEVBUF); + free(db, M_DEVBUF, 0); return NULL; } } @@ -377,8 +377,8 @@ bsd_free(state) struct bsd_db *db = (struct bsd_db *) state; if (db->lens) - free(db->lens, M_DEVBUF); - free(db, M_DEVBUF); + free(db->lens, M_DEVBUF, 0); + free(db, M_DEVBUF, 0); } static void * diff --git a/sys/net/hfsc.c b/sys/net/hfsc.c index 2a5b755cf84..dc84a441b3c 100644 --- a/sys/net/hfsc.c +++ b/sys/net/hfsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hfsc.c,v 1.10 2014/06/30 12:47:23 pelikan Exp $ */ +/* $OpenBSD: hfsc.c,v 1.11 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2012-2013 Henning Brauer <henning@openbsd.org> @@ -150,7 +150,7 @@ hfsc_grow_class_tbl(struct hfsc_if *hif, u_int howmany) hif->hif_class_tbl = newtbl; hif->hif_allocated = howmany; - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); } int @@ -188,8 +188,8 @@ hfsc_detach(struct ifnet *ifp) ifp->if_snd.ifq_hfsc = NULL; hfsc_ellist_destroy(hif->hif_eligible); - free(hif->hif_class_tbl, M_DEVBUF); - free(hif, M_DEVBUF); + free(hif->hif_class_tbl, M_DEVBUF, 0); + free(hif, M_DEVBUF, 0); return (0); } @@ -1007,7 +1007,7 @@ hfsc_ellist_alloc(void) void hfsc_ellist_destroy(hfsc_ellist_t *head) { - free(head, M_DEVBUF); + free(head, M_DEVBUF, 0); } void @@ -1107,7 +1107,7 @@ hfsc_actlist_alloc(void) void hfsc_actlist_destroy(hfsc_actlist_t *head) { - free(head, M_DEVBUF); + free(head, M_DEVBUF, 0); } void diff --git a/sys/net/if.c b/sys/net/if.c index fe04b75bfa5..c3252652f79 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.296 2014/07/12 16:10:04 henning Exp $ */ +/* $OpenBSD: if.c,v 1.297 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -274,7 +274,7 @@ if_attachsetup(struct ifnet *ifp) q = (caddr_t)malloc(n, M_IFADDR, M_WAITOK|M_ZERO); if (ifindex2ifnet) { bcopy((caddr_t)ifindex2ifnet, q, m); - free((caddr_t)ifindex2ifnet, M_IFADDR); + free((caddr_t)ifindex2ifnet, M_IFADDR, 0); } ifindex2ifnet = (struct ifnet **)q; } @@ -597,9 +597,9 @@ do { \ } } - free(ifp->if_addrhooks, M_TEMP); - free(ifp->if_linkstatehooks, M_TEMP); - free(ifp->if_detachhooks, M_TEMP); + free(ifp->if_addrhooks, M_TEMP, 0); + free(ifp->if_linkstatehooks, M_TEMP, 0); + free(ifp->if_detachhooks, M_TEMP, 0); for (dp = domains; dp; dp = dp->dom_next) { if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family]) @@ -834,7 +834,7 @@ if_congestion_clear(void *arg) struct timeout *to = ifq->ifq_congestion; ifq->ifq_congestion = NULL; - free(to, M_TEMP); + free(to, M_TEMP, 0); } /* @@ -1871,7 +1871,7 @@ if_addgroup(struct ifnet *ifp, const char *groupname) return (ENOMEM); if ((ifgm = malloc(sizeof(*ifgm), M_TEMP, M_NOWAIT)) == NULL) { - free(ifgl, M_TEMP); + free(ifgl, M_TEMP, 0); return (ENOMEM); } @@ -1880,8 +1880,8 @@ if_addgroup(struct ifnet *ifp, const char *groupname) break; if (ifg == NULL && (ifg = if_creategroup(groupname)) == NULL) { - free(ifgl, M_TEMP); - free(ifgm, M_TEMP); + free(ifgl, M_TEMP, 0); + free(ifgm, M_TEMP, 0); return (ENOMEM); } @@ -1922,7 +1922,7 @@ if_delgroup(struct ifnet *ifp, const char *groupname) if (ifgm != NULL) { TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm, ifgm_next); - free(ifgm, M_TEMP); + free(ifgm, M_TEMP, 0); } if (--ifgl->ifgl_group->ifg_refcnt == 0) { @@ -1930,10 +1930,10 @@ if_delgroup(struct ifnet *ifp, const char *groupname) #if NPF > 0 pfi_detach_ifgroup(ifgl->ifgl_group); #endif - free(ifgl->ifgl_group, M_TEMP); + free(ifgl->ifgl_group, M_TEMP, 0); } - free(ifgl, M_TEMP); + free(ifgl, M_TEMP, 0); #if NPF > 0 pfi_group_change(groupname); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index b8aac235601..756aac0ef9a 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.224 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.225 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -195,7 +195,7 @@ bridge_clone_create(struct if_clone *ifc, int unit) sc->sc_stp = bstp_create(&sc->sc_if); if (!sc->sc_stp) { - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (ENOMEM); } @@ -248,7 +248,7 @@ bridge_clone_destroy(struct ifnet *ifp) bridge_delete(sc, bif); while ((bif = TAILQ_FIRST(&sc->sc_spanlist)) != NULL) { TAILQ_REMOVE(&sc->sc_spanlist, bif, next); - free(bif, M_DEVBUF); + free(bif, M_DEVBUF, 0); } s = splnet(); @@ -258,7 +258,7 @@ bridge_clone_destroy(struct ifnet *ifp) bstp_destroy(sc->sc_stp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -276,7 +276,7 @@ bridge_delete(struct bridge_softc *sc, struct bridge_iflist *p) TAILQ_REMOVE(&sc->sc_iflist, p, next); bridge_rtdelete(sc, p->ifp, 0); bridge_flushrule(p); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (error); } @@ -444,7 +444,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) if (strncmp(p->ifp->if_xname, req->ifbr_ifsname, sizeof(p->ifp->if_xname)) == 0) { TAILQ_REMOVE(&sc->sc_spanlist, p, next); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); break; } } @@ -817,7 +817,7 @@ bridge_bifconf(struct bridge_softc *sc, struct ifbifconf *bifc) done: if (breq != NULL) - free(breq, M_DEVBUF); + free(breq, M_DEVBUF, 0); bifc->ifbic_len = i * sizeof(*breq); return (error); } @@ -1886,7 +1886,7 @@ bridge_rtage(struct bridge_softc *sc) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } } @@ -1945,7 +1945,7 @@ bridge_rtflush(struct bridge_softc *sc, int full) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } else n = LIST_NEXT(n, brt_next); @@ -1967,7 +1967,7 @@ bridge_rtdaddr(struct bridge_softc *sc, struct ether_addr *ea) if (bcmp(ea, &p->brt_addr, sizeof(p->brt_addr)) == 0) { LIST_REMOVE(p, brt_next); sc->sc_brtcnt--; - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (0); } } @@ -2004,7 +2004,7 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp, int dynonly) p = LIST_NEXT(n, brt_next); LIST_REMOVE(n, brt_next); sc->sc_brtcnt--; - free(n, M_DEVBUF); + free(n, M_DEVBUF, 0); n = p; } } @@ -2183,7 +2183,7 @@ bridge_flushrule(struct bridge_iflist *bif) #if NPF > 0 pf_tag_unref(p->brl_tag); #endif - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!SIMPLEQ_EMPTY(&bif->bif_brlout)) { p = SIMPLEQ_FIRST(&bif->bif_brlout); @@ -2191,7 +2191,7 @@ bridge_flushrule(struct bridge_iflist *bif) #if NPF > 0 pf_tag_unref(p->brl_tag); #endif - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } } diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 083fc5ce665..6bc31ad6ce4 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_enc.c,v 1.54 2014/05/21 14:48:28 mpi Exp $ */ +/* $OpenBSD: if_enc.c,v 1.55 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2010 Reyk Floeter <reyk@vantronix.net> @@ -110,7 +110,7 @@ enc_clone_create(struct if_clone *ifc, int unit) if ((error = enc_setif(ifp, 0)) != 0) { if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (error); } @@ -122,7 +122,7 @@ enc_clone_create(struct if_clone *ifc, int unit) if (enc_allifps != NULL) { memcpy(new, enc_allifps, sizeof(struct ifnet *) * (enc_max_unit + 1)); - free(enc_allifps, M_DEVBUF); + free(enc_allifps, M_DEVBUF, 0); } enc_allifps = new; enc_max_unit = unit; @@ -146,7 +146,7 @@ enc_clone_destroy(struct ifnet *ifp) enc_allifps[sc->sc_unit] = NULL; enc_unsetif(ifp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); splx(s); return (0); @@ -254,7 +254,7 @@ enc_setif(struct ifnet *ifp, u_int id) if (enc_ifps != NULL) { memcpy(new, enc_ifps, sizeof(struct ifnet *) * (enc_max_id + 1)); - free(enc_ifps, M_DEVBUF); + free(enc_ifps, M_DEVBUF, 0); } enc_ifps = new; enc_max_id = id; diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 7ab15bbeef3..e37066984d1 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.173 2014/07/08 07:10:12 dlg Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.174 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -816,7 +816,7 @@ ether_ifdetach(struct ifnet *ifp) enm != NULL; enm = LIST_FIRST(&ac->ac_multiaddrs)) { LIST_REMOVE(enm, enm_list); - free(enm, M_IFMADDR); + free(enm, M_IFMADDR, 0); } #if 0 @@ -1111,7 +1111,7 @@ ether_delmulti(struct ifreq *ifr, struct arpcom *ac) * No remaining claims to this record; unlink and free it. */ LIST_REMOVE(enm, enm_list); - free(enm, M_IFMADDR); + free(enm, M_IFMADDR, 0); ac->ac_multicnt--; if (memcmp(addrlo, addrhi, ETHER_ADDR_LEN) != 0) ac->ac_multirangecnt--; diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 264e83c6325..f0082580ed9 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gif.c,v 1.67 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_gif.c,v 1.68 2014/07/12 18:44:22 tedu Exp $ */ /* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */ /* @@ -135,12 +135,12 @@ gif_clone_destroy(struct ifnet *ifp) if_detach(ifp); if (sc->gif_psrc) - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sc->gif_psrc = NULL; if (sc->gif_pdst) - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sc->gif_pdst = NULL; - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -500,13 +500,13 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (sc->gif_psrc) - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sa = malloc(src->sa_len, M_IFADDR, M_WAITOK); bcopy((caddr_t)src, (caddr_t)sa, src->sa_len); sc->gif_psrc = sa; if (sc->gif_pdst) - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sa = malloc(dst->sa_len, M_IFADDR, M_WAITOK); bcopy((caddr_t)dst, (caddr_t)sa, dst->sa_len); sc->gif_pdst = sa; @@ -522,11 +522,11 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) #ifdef SIOCDIFPHYADDR case SIOCDIFPHYADDR: if (sc->gif_psrc) { - free((caddr_t)sc->gif_psrc, M_IFADDR); + free((caddr_t)sc->gif_psrc, M_IFADDR, 0); sc->gif_psrc = NULL; } if (sc->gif_pdst) { - free((caddr_t)sc->gif_pdst, M_IFADDR); + free((caddr_t)sc->gif_pdst, M_IFADDR, 0); sc->gif_pdst = NULL; } /* change the IFF_{UP, RUNNING} flag as well? */ diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 3e58bc1ef08..9fc289dcf1a 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.68 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_gre.c,v 1.69 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -178,7 +178,7 @@ gre_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index c6307e1df00..75af9049426 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_loop.c,v 1.55 2014/05/14 19:08:33 claudio Exp $ */ +/* $OpenBSD: if_loop.c,v 1.56 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */ /* @@ -199,7 +199,7 @@ loop_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(ifp, M_DEVBUF); + free(ifp, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_media.c b/sys/net/if_media.c index b601952a1d9..9755591cdeb 100644 --- a/sys/net/if_media.c +++ b/sys/net/if_media.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_media.c,v 1.22 2014/01/19 13:47:03 pelikan Exp $ */ +/* $OpenBSD: if_media.c,v 1.23 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $ */ /*- @@ -327,7 +327,7 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, struct ifmedia *ifm, nwords * sizeof(int)); else error = E2BIG; - free(kptr, M_TEMP); + free(kptr, M_TEMP, 0); } ifmr->ifm_count = nwords; break; @@ -380,7 +380,7 @@ ifmedia_delete_instance(struct ifmedia *ifm, u_int inst) if (inst == IFM_INST_ANY || inst == IFM_INST(ife->ifm_media)) { TAILQ_REMOVE(&ifm->ifm_list, ife, ifm_list); - free(ife, M_IFADDR); + free(ife, M_IFADDR, 0); } } } diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index bce4c49dd76..0c708de75cd 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.33 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.34 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -129,7 +129,7 @@ mpe_clone_destroy(struct ifnet *ifp) splx(s); if_detach(ifp); - free(mpeif, M_DEVBUF); + free(mpeif, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c index 104f27ebfa7..7a597e8fa5e 100644 --- a/sys/net/if_pflog.c +++ b/sys/net/if_pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflog.c,v 1.60 2014/07/09 11:03:04 henning Exp $ */ +/* $OpenBSD: if_pflog.c,v 1.61 2014/07/12 18:44:22 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -129,7 +129,7 @@ pflogifs_resize(size_t n) p[i] = NULL; if (pflogifs) - free(pflogifs, M_DEVBUF); + free(pflogifs, M_DEVBUF, 0); pflogifs = p; npflogifs = n; return (0); @@ -193,7 +193,7 @@ pflog_clone_destroy(struct ifnet *ifp) splx(s); if_detach(ifp); - free(pflogif, M_DEVBUF); + free(pflogif, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c index 393316aeda6..b3ad4befd14 100644 --- a/sys/net/if_pflow.c +++ b/sys/net/if_pflow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pflow.c,v 1.43 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_pflow.c,v 1.44 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2011 Florian Obser <florian@narrans.de> @@ -271,8 +271,8 @@ pflow_clone_destroy(struct ifnet *ifp) pflow_flush(sc); if_detach(ifp); SLIST_REMOVE(&pflowif_list, sc, pflow_softc, sc_next); - free(sc->sc_imo.imo_membership, M_IPMOPTS); - free(sc, M_DEVBUF); + free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); + free(sc, M_DEVBUF, 0); splx(s); return (0); } diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 0d11d5ab067..365b81c782d 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.206 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.207 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -381,8 +381,8 @@ pfsync_clone_destroy(struct ifnet *ifp) } pool_destroy(&sc->sc_pool); - free(sc->sc_imo.imo_membership, M_IPMOPTS); - free(sc, M_DEVBUF); + free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); + free(sc, M_DEVBUF, 0); pfsyncif = NULL; splx(s); diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c index 5cb44e75ac4..cff0149e64b 100644 --- a/sys/net/if_ppp.c +++ b/sys/net/if_ppp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ppp.c,v 1.74 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_ppp.c,v 1.75 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */ /* @@ -274,7 +274,7 @@ ppp_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -367,19 +367,19 @@ pppdealloc(struct ppp_softc *sc) #endif /* PPP_COMPRESS */ #if NBPFILTER > 0 if (sc->sc_pass_filt.bf_insns != 0) { - free(sc->sc_pass_filt.bf_insns, M_DEVBUF); + free(sc->sc_pass_filt.bf_insns, M_DEVBUF, 0); sc->sc_pass_filt.bf_insns = 0; sc->sc_pass_filt.bf_len = 0; } if (sc->sc_active_filt.bf_insns != 0) { - free(sc->sc_active_filt.bf_insns, M_DEVBUF); + free(sc->sc_active_filt.bf_insns, M_DEVBUF, 0); sc->sc_active_filt.bf_insns = 0; sc->sc_active_filt.bf_len = 0; } #endif #ifdef VJC if (sc->sc_comp != 0) { - free(sc->sc_comp, M_DEVBUF); + free(sc->sc_comp, M_DEVBUF, 0); sc->sc_comp = 0; } #endif @@ -569,11 +569,11 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, int flag, newcode = malloc(newcodelen, M_DEVBUF, M_WAITOK); if ((error = copyin((caddr_t)nbp->bf_insns, (caddr_t)newcode, newcodelen)) != 0) { - free(newcode, M_DEVBUF); + free(newcode, M_DEVBUF, 0); return error; } if (!bpf_validate(newcode, nbp->bf_len)) { - free(newcode, M_DEVBUF); + free(newcode, M_DEVBUF, 0); return EINVAL; } } else @@ -585,7 +585,7 @@ pppioctl(struct ppp_softc *sc, u_long cmd, caddr_t data, int flag, bp->bf_insns = newcode; splx(s); if (oldcode != 0) - free(oldcode, M_DEVBUF); + free(oldcode, M_DEVBUF, 0); break; #endif diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c index da5341d5256..efa97fe3d85 100644 --- a/sys/net/if_pppoe.c +++ b/sys/net/if_pppoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppoe.c,v 1.39 2014/06/07 11:04:14 henning Exp $ */ +/* $OpenBSD: if_pppoe.c,v 1.40 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */ /* @@ -280,15 +280,15 @@ pppoe_clone_destroy(struct ifnet *ifp) if_detach(ifp); if (sc->sc_concentrator_name) - free(sc->sc_concentrator_name, M_DEVBUF); + free(sc->sc_concentrator_name, M_DEVBUF, 0); if (sc->sc_service_name) - free(sc->sc_service_name, M_DEVBUF); + free(sc->sc_service_name, M_DEVBUF, 0); if (sc->sc_ac_cookie) - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); if (sc->sc_relay_sid) - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -600,7 +600,7 @@ breakbreak: } if (hunique) { if (sc->sc_hunique) - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = malloc(hunique_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_hunique == NULL) @@ -642,7 +642,7 @@ breakbreak: } if (hunique) { if (sc->sc_hunique) - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = malloc(hunique_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_hunique == NULL) @@ -674,7 +674,7 @@ breakbreak: } if (ac_cookie) { if (sc->sc_ac_cookie) - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = malloc(ac_cookie_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_ac_cookie == NULL) @@ -684,7 +684,7 @@ breakbreak: } if (relay_sid) { if (sc->sc_relay_sid) - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = malloc(relay_sid_len, M_DEVBUF, M_DONTWAIT); if (sc->sc_relay_sid == NULL) @@ -737,11 +737,11 @@ breakbreak: sc->sc_state = PPPOE_STATE_INITIAL; memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest)); if (sc->sc_ac_cookie) { - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = NULL; } if (sc->sc_relay_sid) { - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = NULL; } sc->sc_ac_cookie_len = 0; @@ -938,7 +938,7 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) } if (sc->sc_concentrator_name) - free(sc->sc_concentrator_name, M_DEVBUF); + free(sc->sc_concentrator_name, M_DEVBUF, 0); sc->sc_concentrator_name = NULL; len = strlen(parms->ac_name); @@ -951,7 +951,7 @@ pppoe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) } if (sc->sc_service_name) - free(sc->sc_service_name, M_DEVBUF); + free(sc->sc_service_name, M_DEVBUF, 0); sc->sc_service_name = NULL; len = strlen(parms->service_name); @@ -1263,18 +1263,18 @@ pppoe_disconnect(struct pppoe_softc *sc) sc->sc_state = PPPOE_STATE_INITIAL; memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest)); if (sc->sc_ac_cookie) { - free(sc->sc_ac_cookie, M_DEVBUF); + free(sc->sc_ac_cookie, M_DEVBUF, 0); sc->sc_ac_cookie = NULL; } sc->sc_ac_cookie_len = 0; if (sc->sc_relay_sid) { - free(sc->sc_relay_sid, M_DEVBUF); + free(sc->sc_relay_sid, M_DEVBUF, 0); sc->sc_relay_sid = NULL; } sc->sc_relay_sid_len = 0; #ifdef PPPOE_SERVER if (sc->sc_hunique) { - free(sc->sc_hunique, M_DEVBUF); + free(sc->sc_hunique, M_DEVBUF, 0); sc->sc_hunique = NULL; } sc->sc_hunique_len = 0; diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index 66b2a836043..3e71ec6b54f 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.30 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.31 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -603,11 +603,11 @@ pppxclose(dev_t dev, int flags, int mode, struct proc *p) IF_PURGE(&pxd->pxd_svcq); splx(s); - free(pxd, M_DEVBUF); + free(pxd, M_DEVBUF, 0); if (LIST_EMPTY(&pppx_devs)) { pool_destroy(pppx_if_pl); - free(pppx_if_pl, M_DEVBUF); + free(pppx_if_pl, M_DEVBUF, 0); pppx_if_pl = NULL; } @@ -660,7 +660,7 @@ pppx_if_find(struct pppx_dev *pxd, int session_id, int protocol) p = RB_FIND(pppx_ifs, &pppx_ifs, s); rw_exit_read(&pppx_ifs_lk); - free(s, M_DEVBUF); + free(s, M_DEVBUF, 0); return (p); } diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 48a743ca31d..052124f49aa 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sl.c,v 1.51 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: if_sl.c,v 1.52 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_sl.c,v 1.39.4.1 1996/06/02 16:26:31 thorpej Exp $ */ /* @@ -243,7 +243,7 @@ sl_clone_destroy(ifp) if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index afbced7c8c7..d3ff56ac9a8 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.123 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.124 2014/07/12 18:44:22 tedu Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -906,13 +906,13 @@ sppp_detach(struct ifnet *ifp) /* release authentication data */ if (sp->myauth.name != NULL) - free(sp->myauth.name, M_DEVBUF); + free(sp->myauth.name, M_DEVBUF, 0); if (sp->myauth.secret != NULL) - free(sp->myauth.secret, M_DEVBUF); + free(sp->myauth.secret, M_DEVBUF, 0); if (sp->hisauth.name != NULL) - free(sp->hisauth.name, M_DEVBUF); + free(sp->hisauth.name, M_DEVBUF, 0); if (sp->hisauth.secret != NULL) - free(sp->hisauth.secret, M_DEVBUF); + free(sp->hisauth.secret, M_DEVBUF, 0); } /* @@ -2115,7 +2115,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len) p = (void*) (h+1); for (rlen = 0; len > 1; len -= p[1], p += p[1]) { if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -2292,7 +2292,7 @@ sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -2698,7 +2698,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len) p = (void*) (h+1); for (rlen = 0; len > 1; len -= p[1], p += p[1]) { if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -2842,7 +2842,7 @@ sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -3166,7 +3166,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len) for (rlen=0; len>1 && p[1]; len-=p[1], p+=p[1]) { /* Sanity check option length */ if (p[1] < 2 || p[1] > len) { - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (-1); } if (debug) @@ -3300,7 +3300,7 @@ sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len) } end: - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (rlen == 0); } @@ -4880,10 +4880,10 @@ sppp_get_params(struct sppp *sp, struct ifreq *ifr) spr->phase = sp->pp_phase; if (copyout(spr, (caddr_t)ifr->ifr_data, sizeof(*spr)) != 0) { - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); return EFAULT; } - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); break; } case SPPPIOGMAUTH: @@ -4903,10 +4903,10 @@ sppp_get_params(struct sppp *sp, struct ifreq *ifr) strlcpy(spa->name, auth->name, sizeof(spa->name)); if (copyout(spa, (caddr_t)ifr->ifr_data, sizeof(*spa)) != 0) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EFAULT; } - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); break; } default: @@ -4946,7 +4946,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) spr = malloc(sizeof(*spr), M_DEVBUF, M_WAITOK); if (copyin((caddr_t)ifr->ifr_data, spr, sizeof(*spr)) != 0) { - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); return EFAULT; } /* @@ -4955,7 +4955,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) * * XXX Should allow to set or clear pp_flags. */ - free(spr, M_DEVBUF); + free(spr, M_DEVBUF, 0); break; } case SPPPIOSMAUTH: @@ -4982,22 +4982,22 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) auth = (cmd == SPPPIOSMAUTH) ? &sp->myauth : &sp->hisauth; if (copyin((caddr_t)ifr->ifr_data, spa, sizeof(*spa)) != 0) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EFAULT; } if (spa->proto != 0 && spa->proto != PPP_PAP && spa->proto != PPP_CHAP) { - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); return EINVAL; } if (spa->proto == 0) { /* resetting auth */ if (auth->name != NULL) - free(auth->name, M_DEVBUF); + free(auth->name, M_DEVBUF, 0); if (auth->secret != NULL) - free(auth->secret, M_DEVBUF); + free(auth->secret, M_DEVBUF, 0); bzero(auth, sizeof *auth); explicit_bzero(sp->chap_challenge, sizeof sp->chap_challenge); } else { @@ -5010,7 +5010,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) p = malloc(len, M_DEVBUF, M_WAITOK); strlcpy(p, spa->name, len); if (auth->name != NULL) - free(auth->name, M_DEVBUF); + free(auth->name, M_DEVBUF, 0); auth->name = p; if (spa->secret[0] != '\0') { @@ -5019,7 +5019,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) p = malloc(len, M_DEVBUF, M_WAITOK); strlcpy(p, spa->secret, len); if (auth->secret != NULL) - free(auth->secret, M_DEVBUF); + free(auth->secret, M_DEVBUF, 0); auth->secret = p; } else if (!auth->secret) { p = malloc(1, M_DEVBUF, M_WAITOK); @@ -5027,7 +5027,7 @@ sppp_set_params(struct sppp *sp, struct ifreq *ifr) auth->secret = p; } } - free(spa, M_DEVBUF); + free(spa, M_DEVBUF, 0); break; } default: diff --git a/sys/net/if_trunk.c b/sys/net/if_trunk.c index 67128e53464..aadf2d7bd28 100644 --- a/sys/net/if_trunk.c +++ b/sys/net/if_trunk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_trunk.c,v 1.88 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: if_trunk.c,v 1.89 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org> @@ -169,7 +169,7 @@ trunk_clone_create(struct if_clone *ifc, int unit) if (trunk_protos[i].ti_proto == TRUNK_PROTO_DEFAULT) { tr->tr_proto = trunk_protos[i].ti_proto; if ((error = trunk_protos[i].ti_attach(tr)) != 0) { - free(tr, M_DEVBUF); + free(tr, M_DEVBUF, 0); return (error); } break; @@ -235,7 +235,7 @@ trunk_clone_destroy(struct ifnet *ifp) if_detach(ifp); SLIST_REMOVE(&trunk_list, tr, trunk_softc, tr_entries); - free(tr, M_DEVBUF); + free(tr, M_DEVBUF, 0); splx(s); @@ -337,7 +337,7 @@ trunk_port_create(struct trunk_softc *tr, struct ifnet *ifp) tp->tp_flags |= TRUNK_PORT_STACK; if (trunk_port_checkstacking(tr_ptr) >= TRUNK_MAX_STACKING) { - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); return (E2BIG); } } @@ -463,7 +463,7 @@ trunk_port_destroy(struct trunk_port *tp) /* Reset the port lladdr */ trunk_port_lladdr(tp, tp->tp_lladdr); - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); /* Update trunk capabilities */ tr->tr_capabilities = trunk_capabilities(tr); @@ -841,7 +841,7 @@ trunk_ether_delmulti(struct trunk_softc *tr, struct ifreq *ifr) } SLIST_REMOVE(&tr->tr_mc_head, mc, trunk_mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); return (0); } @@ -860,7 +860,7 @@ trunk_ether_purgemulti(struct trunk_softc *tr) trunk_ioctl_allports(tr, SIOCDELMULTI, (caddr_t)ifr); SLIST_REMOVE(&tr->tr_mc_head, mc, trunk_mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } } @@ -1414,7 +1414,7 @@ trunk_lb_detach(struct trunk_softc *tr) { struct trunk_lb *lb = (struct trunk_lb *)tr->tr_psc; if (lb != NULL) - free(lb, M_DEVBUF); + free(lb, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 7d705463df4..9f62d5b8314 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.125 2014/05/05 11:44:33 mpi Exp $ */ +/* $OpenBSD: if_tun.c,v 1.126 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -246,7 +246,7 @@ tun_clone_destroy(struct ifnet *ifp) if_detach(ifp); - free(tp, M_DEVBUF); + free(tp, M_DEVBUF, 0); return (0); } @@ -322,7 +322,7 @@ tun_switch(struct tun_softc *tp, int flags) } abort: if (ifgrpnames) - free(ifgrpnames, M_TEMP); + free(ifgrpnames, M_TEMP, 0); return (r); } diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c index 7b1b5b6e561..c2d4cd02996 100644 --- a/sys/net/if_vether.c +++ b/sys/net/if_vether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vether.c,v 1.19 2013/10/19 14:46:31 mpi Exp $ */ +/* $OpenBSD: if_vether.c,v 1.20 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2009 Theo de Raadt @@ -108,7 +108,7 @@ vether_clone_destroy(struct ifnet *ifp) ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 15a03d8a134..a5779f26f10 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vlan.c,v 1.107 2014/07/11 10:48:50 henning Exp $ */ +/* $OpenBSD: if_vlan.c,v 1.108 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright 1998 Massachusetts Institute of Technology @@ -164,7 +164,7 @@ vlan_clone_destroy(struct ifnet *ifp) vlan_unconfig(ifp, NULL); ether_ifdetach(ifp); if_detach(ifp); - free(ifv, M_DEVBUF); + free(ifv, M_DEVBUF, 0); return (0); } @@ -649,7 +649,7 @@ vlan_ether_addmulti(struct ifvlan *ifv, struct ifreq *ifr) ioctl_failed: LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); alloc_failed: (void)ether_delmulti(ifr, (struct arpcom *)&ifv->ifv_ac); @@ -690,7 +690,7 @@ vlan_ether_delmulti(struct ifvlan *ifv, struct ifreq *ifr) if ((error = (*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr)) != 0) { /* And forget about this address. */ LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } else (void)ether_addmulti(ifr, (struct arpcom *)&ifv->ifv_ac); return (error); @@ -719,7 +719,7 @@ vlan_ether_purgemulti(struct ifvlan *ifv) memcpy(&ifr->ifr_addr, &mc->mc_addr, mc->mc_addr.ss_len); (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr); LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } } diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index ee357be4d9c..5adc84b5d31 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vxlan.c,v 1.13 2014/04/21 12:22:25 henning Exp $ */ +/* $OpenBSD: if_vxlan.c,v 1.14 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org> @@ -168,8 +168,8 @@ vxlan_clone_destroy(struct ifnet *ifp) ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY); ether_ifdetach(ifp); if_detach(ifp); - free(sc->sc_imo.imo_membership, M_IPMOPTS); - free(sc, M_DEVBUF); + free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); + free(sc, M_DEVBUF, 0); return (0); } diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 4fc1fb50c09..638cccf715f 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.72 2014/01/22 04:33:34 henning Exp $ */ +/* $OpenBSD: pf_if.c,v 1.73 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -190,7 +190,7 @@ pfi_kif_unref(struct pfi_kif *kif, enum pfi_kif_refs what) return; RB_REMOVE(pfi_ifhead, &pfi_ifs, kif); - free(kif, PFI_MTYPE); + free(kif, PFI_MTYPE, 0); } int @@ -563,7 +563,7 @@ pfi_address_add(struct sockaddr *sa, int af, int net) } memcpy(p, pfi_buffer, pfi_buffer_max * sizeof(*pfi_buffer)); /* no need to zero buffer */ - free(pfi_buffer, PFI_MTYPE); + free(pfi_buffer, PFI_MTYPE, 0); pfi_buffer = p; pfi_buffer_max = new_max; } diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 5ad762c1f18..56330d994eb 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.272 2014/04/22 14:41:03 mpi Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.273 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -399,7 +399,7 @@ tag_unref(struct pf_tags *head, u_int16_t tag) if (tag == p->tag) { if (--p->ref == 0) { TAILQ_REMOVE(head, p, entries); - free(p, M_TEMP); + free(p, M_TEMP, 0); } break; } @@ -729,7 +729,7 @@ pf_commit_rules(u_int32_t ticket, char *anchor) while ((rule = TAILQ_FIRST(old_rules)) != NULL) pf_rm_rule(old_rules, rule); if (rs->rules.inactive.ptr_array) - free(rs->rules.inactive.ptr_array, M_TEMP); + free(rs->rules.inactive.ptr_array, M_TEMP, 0); rs->rules.inactive.ptr_array = NULL; rs->rules.inactive.rcount = 0; rs->rules.inactive.open = 0; @@ -751,7 +751,7 @@ pf_setup_pfsync_matching(struct pf_ruleset *rs) MD5Init(&ctx); if (rs->rules.inactive.ptr_array) - free(rs->rules.inactive.ptr_array, M_TEMP); + free(rs->rules.inactive.ptr_array, M_TEMP, 0); rs->rules.inactive.ptr_array = NULL; if (rs->rules.inactive.rcount) { @@ -1482,7 +1482,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) pf_state_export(pstore, state); error = copyout(pstore, p, sizeof(*p)); if (error) { - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); goto fail; } p++; @@ -1493,7 +1493,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) ps->ps_len = sizeof(struct pfsync_state) * nr; - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); break; } @@ -1948,8 +1948,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) bzero(&pf_trans_set, sizeof(pf_trans_set)); for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -1960,29 +1960,29 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_begin(table, &ioe->ticket, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; } break; default: if ((error = pf_begin_rules(&ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; } break; } if (copyout(ioe, io->array+i, sizeof(io->array[i]))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } } - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2000,8 +2000,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) table = malloc(sizeof(*table), M_TEMP, M_WAITOK); for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2012,23 +2012,23 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_rollback(table, ioe->ticket, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; default: if ((error = pf_rollback_rules(ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; } } - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2048,8 +2048,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) /* first makes sure everything will succeed */ for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2058,8 +2058,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) rs = pf_find_ruleset(ioe->anchor); if (rs == NULL || !rs->topen || ioe->ticket != rs->tticket) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2070,8 +2070,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) !rs->rules.inactive.open || rs->rules.inactive.ticket != ioe->ticket) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2086,8 +2086,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) for (i = 0; i < PF_LIMIT_MAX; i++) { if (((struct pool *)pf_pool_limits[i].pp)->pr_nout > pf_pool_limits[i].limit_new) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; } @@ -2095,8 +2095,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) /* now do the commit - no errors should happen here */ for (i = 0; i < io->size; i++) { if (copyin(io->array+i, ioe, sizeof(*ioe))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EFAULT; goto fail; } @@ -2107,16 +2107,16 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) sizeof(table->pfrt_anchor)); if ((error = pfr_ina_commit(table, ioe->ticket, NULL, NULL, 0))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; default: if ((error = pf_commit_rules(ioe->ticket, ioe->anchor))) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); goto fail; /* really bad */ } break; @@ -2127,8 +2127,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) pf_pool_limits[i].limit && pool_sethardlimit(pf_pool_limits[i].pp, pf_pool_limits[i].limit_new, NULL, 0) != 0) { - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); error = EBUSY; goto fail; /* really bad */ } @@ -2145,8 +2145,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } pfi_xcommit(); pf_trans_set_commit(); - free(table, M_TEMP); - free(ioe, M_TEMP); + free(table, M_TEMP, 0); + free(ioe, M_TEMP, 0); break; } @@ -2195,7 +2195,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = copyout(pstore, p, sizeof(*p)); if (error) { - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); goto fail; } p++; @@ -2203,7 +2203,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } psn->psn_len = sizeof(struct pf_src_node) * nr; - free(pstore, M_TEMP); + free(pstore, M_TEMP, 0); break; } diff --git a/sys/net/pf_ruleset.c b/sys/net/pf_ruleset.c index 1951001fbdc..bca6acfd3b6 100644 --- a/sys/net/pf_ruleset.c +++ b/sys/net/pf_ruleset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ruleset.c,v 1.7 2012/11/15 17:44:10 deraadt Exp $ */ +/* $OpenBSD: pf_ruleset.c,v 1.8 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -58,7 +58,7 @@ #ifdef _KERNEL #define rs_malloc(x) malloc(x, M_TEMP, M_WAITOK|M_CANFAIL|M_ZERO) -#define rs_free(x) free(x, M_TEMP) +#define rs_free(x) free(x, M_TEMP, 0) #else /* Userland equivalents so we can lend code to pfctl et al. */ diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index a58c21d02fc..7e8d1a2ce67 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.101 2013/07/05 13:07:58 blambert Exp $ */ +/* $OpenBSD: pf_table.c,v 1.102 2014/07/12 18:44:22 tedu Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -2014,9 +2014,9 @@ pfr_destroy_ktable(struct pfr_ktable *kt, int flushaddr) pfr_destroy_kentries(&addrq); } if (kt->pfrkt_ip4 != NULL) - free((caddr_t)kt->pfrkt_ip4, M_RTABLE); + free((caddr_t)kt->pfrkt_ip4, M_RTABLE, 0); if (kt->pfrkt_ip6 != NULL) - free((caddr_t)kt->pfrkt_ip6, M_RTABLE); + free((caddr_t)kt->pfrkt_ip6, M_RTABLE, 0); if (kt->pfrkt_shadow != NULL) pfr_destroy_ktable(kt->pfrkt_shadow, flushaddr); if (kt->pfrkt_rs != NULL) { diff --git a/sys/net/pfkey.c b/sys/net/pfkey.c index 98fb149b2c5..44d5a041f39 100644 --- a/sys/net/pfkey.c +++ b/sys/net/pfkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkey.c,v 1.20 2012/11/27 17:29:07 mikeb Exp $ */ +/* $OpenBSD: pfkey.c,v 1.21 2014/07/12 18:44:22 tedu Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -218,7 +218,7 @@ pfkey_attach(struct socket *socket, struct mbuf *proto, struct proc *p) return (0); ret: - free(socket->so_pcb, M_PCB); + free(socket->so_pcb, M_PCB, 0); return (rval); } @@ -317,7 +317,7 @@ pfkey_buildprotosw(void) } if (pfkey_domain.dom_protosw) - free(pfkey_domain.dom_protosw, M_PFKEY); + free(pfkey_domain.dom_protosw, M_PFKEY, 0); pfkey_domain.dom_protosw = protosw; pfkey_domain.dom_protoswNPROTOSW = p; @@ -330,7 +330,7 @@ pfkey_buildprotosw(void) sizeof(struct protosw)); if (pfkey_domain.dom_protosw) - free(pfkey_domain.dom_protosw, M_PFKEY); + free(pfkey_domain.dom_protosw, M_PFKEY, 0); pfkey_domain.dom_protosw = protosw; pfkey_domain.dom_protoswNPROTOSW = protosw; diff --git a/sys/net/pfkeyv2.c b/sys/net/pfkeyv2.c index c6554cbd612..2eee83fe76e 100644 --- a/sys/net/pfkeyv2.c +++ b/sys/net/pfkeyv2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2.c,v 1.132 2014/01/08 02:39:02 deraadt Exp $ */ +/* $OpenBSD: pfkeyv2.c,v 1.133 2014/07/12 18:44:22 tedu Exp $ */ /* * @(#)COPYRIGHT 1.1 (NRL) 17 January 1995 @@ -197,7 +197,7 @@ pfkeyv2_release(struct socket *socket) if (pfkeyv2_socket->flags & PFKEYV2_SOCKETFLAGS_PROMISC) npromisc--; - free(pfkeyv2_socket, M_PFKEY); + free(pfkeyv2_socket, M_PFKEY, 0); } return (0); @@ -345,7 +345,7 @@ pfkeyv2_sendmessage(void **headers, int mode, struct socket *socket, ret: if (buffer != NULL) { bzero(buffer, j + sizeof(struct sadb_msg)); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -753,7 +753,7 @@ pfkeyv2_dump_walker(struct tdb *sa, void *state, int last) PFKEYV2_SENDMESSAGE_UNICAST, dump_state->socket, 0, 0, sa->tdb_rdomain); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); if (rval) return (rval); } @@ -922,7 +922,7 @@ pfkeyv2_send(struct socket *socket, void *message, int len) /* Paranoid */ explicit_bzero(freeme, sizeof(struct sadb_msg) + len); - free(freeme, M_PFKEY); + free(freeme, M_PFKEY, 0); freeme = NULL; } @@ -1872,13 +1872,13 @@ ret: realret: if (freeme) - free(freeme, M_PFKEY); + free(freeme, M_PFKEY, 0); explicit_bzero(message, len); - free(message, M_PFKEY); + free(message, M_PFKEY, 0); if (sa1) - free(sa1, M_PFKEY); + free(sa1, M_PFKEY, 0); return (rval); @@ -2156,7 +2156,7 @@ pfkeyv2_acquire(struct ipsec_policy *ipo, union sockaddr_union *gw, ret: if (buffer != NULL) { bzero(buffer, i); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -2238,7 +2238,7 @@ pfkeyv2_expire(struct tdb *sa, u_int16_t type) ret: if (buffer != NULL) { bzero(buffer, i); - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); } return (rval); @@ -2302,7 +2302,7 @@ pfkeyv2_sysctl_walker(struct tdb *sa, void *arg, int last) done: if (buffer) - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); return (error); } @@ -2515,7 +2515,7 @@ pfkeyv2_sysctl_policydumper(struct ipsec_policy *ipo, void *arg) done: if (buffer) - free(buffer, M_PFKEY); + free(buffer, M_PFKEY, 0); return (error); } diff --git a/sys/net/pfkeyv2_convert.c b/sys/net/pfkeyv2_convert.c index 47d0dc4b027..6b20cfcb8f5 100644 --- a/sys/net/pfkeyv2_convert.c +++ b/sys/net/pfkeyv2_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkeyv2_convert.c,v 1.42 2013/10/24 11:31:43 mpi Exp $ */ +/* $OpenBSD: pfkeyv2_convert.c,v 1.43 2014/07/12 18:44:22 tedu Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@keromytis.org) * @@ -743,7 +743,7 @@ import_auth(struct tdb *tdb, struct sadb_x_cred *sadb_auth, int dstauth) (*ipr)->ref_type = IPSP_AUTH_RSA; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } @@ -781,7 +781,7 @@ import_credentials(struct tdb *tdb, struct sadb_x_cred *sadb_cred, int dstcred) (*ipr)->ref_type = IPSP_CRED_KEYNOTE; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } @@ -825,7 +825,7 @@ import_identity(struct tdb *tdb, struct sadb_ident *sadb_ident, int type) (*ipr)->ref_type = IPSP_IDENTITY_CONNECTION; break; default: - free(*ipr, M_CREDENTIALS); + free(*ipr, M_CREDENTIALS, 0); *ipr = NULL; return; } diff --git a/sys/net/pipex.c b/sys/net/pipex.c index 2fec5362900..dfd5cb332c5 100644 --- a/sys/net/pipex.c +++ b/sys/net/pipex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pipex.c,v 1.53 2014/06/13 06:47:09 yasuoka Exp $ */ +/* $OpenBSD: pipex.c,v 1.54 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -397,7 +397,7 @@ pipex_add_session(struct pipex_session_req *req, #ifdef PIPEX_MPPE if ((req->pr_ppp_flags & PIPEX_PPP_MPPE_ACCEPTED) != 0) { if (req->pr_mppe_recv.keylenbits <= 0) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } pipex_session_init_mppe_recv(session, @@ -406,7 +406,7 @@ pipex_add_session(struct pipex_session_req *req, } if ((req->pr_ppp_flags & PIPEX_PPP_MPPE_ENABLED) != 0) { if (req->pr_mppe_send.keylenbits <= 0) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } pipex_session_init_mppe_send(session, @@ -417,7 +417,7 @@ pipex_add_session(struct pipex_session_req *req, if (pipex_session_is_mppe_required(session)) { if (!pipex_session_is_mppe_enabled(session) || !pipex_session_is_mppe_accepted(session)) { - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EINVAL); } } @@ -429,7 +429,7 @@ pipex_add_session(struct pipex_session_req *req, if (pipex_lookup_by_ip_address(session->ip_address.sin_addr) != NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (EADDRINUSE); } @@ -437,7 +437,7 @@ pipex_add_session(struct pipex_session_req *req, &session->ip_netmask, &pipex_rd_head4, session->ps4_rn, RTP_STATIC); if (rn == NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (ENOMEM); } } @@ -447,7 +447,7 @@ pipex_add_session(struct pipex_session_req *req, RTP_STATIC); if (rn == NULL) { splx(s); - free(session, M_TEMP); + free(session, M_TEMP, 0); return (ENOMEM); } } @@ -626,8 +626,8 @@ pipex_destroy_session(struct pipex_session *session) splx(s); if (session->mppe_recv.old_session_keys) - free(session->mppe_recv.old_session_keys, M_TEMP); - free(session, M_TEMP); + free(session->mppe_recv.old_session_keys, M_TEMP, 0); + free(session, M_TEMP, 0); return (0); } diff --git a/sys/net/ppp-deflate.c b/sys/net/ppp-deflate.c index 052e07ac3b6..b7bc690c483 100644 --- a/sys/net/ppp-deflate.c +++ b/sys/net/ppp-deflate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp-deflate.c,v 1.9 2011/07/07 02:57:25 deraadt Exp $ */ +/* $OpenBSD: ppp-deflate.c,v 1.10 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ppp-deflate.c,v 1.1 1996/03/15 02:28:09 paulus Exp $ */ /* @@ -140,7 +140,7 @@ zcfree(notused, ptr) void *notused; void *ptr; { - free(ptr, M_DEVBUF); + free(ptr, M_DEVBUF, 0); } /* @@ -173,7 +173,7 @@ z_comp_alloc(options, opt_len) state->strm.zfree = zcfree; if (deflateInit2(&state->strm, Z_DEFAULT_COMPRESSION, DEFLATE_METHOD_VAL, -w_size, 8, Z_DEFAULT_STRATEGY) != Z_OK) { - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); return NULL; } @@ -189,7 +189,7 @@ z_comp_free(arg) struct deflate_state *state = (struct deflate_state *) arg; deflateEnd(&state->strm); - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); } static int @@ -404,7 +404,7 @@ z_decomp_alloc(options, opt_len) state->strm.zalloc = zcalloc; state->strm.zfree = zcfree; if (inflateInit2(&state->strm, -w_size) != Z_OK) { - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); return NULL; } @@ -420,7 +420,7 @@ z_decomp_free(arg) struct deflate_state *state = (struct deflate_state *) arg; inflateEnd(&state->strm); - free(state, M_DEVBUF); + free(state, M_DEVBUF, 0); } static int diff --git a/sys/net/radix.c b/sys/net/radix.c index 76da7383fe9..c9108ab0948 100644 --- a/sys/net/radix.c +++ b/sys/net/radix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radix.c,v 1.41 2014/07/01 09:58:40 mpi Exp $ */ +/* $OpenBSD: radix.c,v 1.42 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: radix.c,v 1.20 2003/08/07 16:32:56 agc Exp $ */ /* @@ -441,7 +441,7 @@ rn_addmask(void *n_arg, int search, int skip) tm = rn_insert(cp, mask_rnhead, &maskduplicated, tm); if (maskduplicated) { log(LOG_ERR, "rn_addmask: mask impossibly already in tree\n"); - free(saved_tm, M_RTABLE); + free(saved_tm, M_RTABLE, 0); return (tm); } /* diff --git a/sys/net/raw_cb.c b/sys/net/raw_cb.c index 9c2ba08a610..a921071da87 100644 --- a/sys/net/raw_cb.c +++ b/sys/net/raw_cb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_cb.c,v 1.6 2012/01/11 23:47:06 bluhm Exp $ */ +/* $OpenBSD: raw_cb.c,v 1.7 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: raw_cb.c,v 1.9 1996/02/13 22:00:39 christos Exp $ */ /* @@ -102,7 +102,7 @@ raw_detach(struct rawcb *rp) m_freem(dtom(rp->rcb_laddr)); rp->rcb_laddr = 0; #endif - free((caddr_t)(rp), M_PCB); + free((caddr_t)(rp), M_PCB, 0); } /* diff --git a/sys/net/route.c b/sys/net/route.c index 4b0224ab0b4..1f8f7635b89 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.173 2014/07/12 17:57:26 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.174 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -250,14 +250,14 @@ rtable_add(u_int id) if ((p = malloc(newlen, M_RTABLE, M_NOWAIT|M_ZERO)) == NULL) return (ENOMEM); if ((q = malloc(newlen2, M_RTABLE, M_NOWAIT|M_ZERO)) == NULL) { - free(p, M_RTABLE); + free(p, M_RTABLE, 0); return (ENOMEM); } if (rt_tables) { bcopy(rt_tables, p, sizeof(void *) * (rtbl_id_max+1)); bcopy(rt_tab2dom, q, sizeof(u_int) * (rtbl_id_max+1)); - free(rt_tables, M_RTABLE); - free(rt_tab2dom, M_RTABLE); + free(rt_tables, M_RTABLE, 0); + free(rt_tab2dom, M_RTABLE, 0); } rt_tables = p; rt_tab2dom = q; @@ -412,9 +412,9 @@ rtfree(struct rtentry *rt) rtlabel_unref(rt->rt_labelid); #ifdef MPLS if (rt->rt_flags & RTF_MPLS) - free(rt->rt_llinfo, M_TEMP); + free(rt->rt_llinfo, M_TEMP, 0); #endif - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); } } @@ -442,7 +442,7 @@ ifafree(struct ifaddr *ifa) if (ifa == NULL) panic("ifafree"); if (ifa->ifa_refcnt == 0) - free(ifa, M_IFADDR); + free(ifa, M_IFADDR, 0); else ifa->ifa_refcnt--; } @@ -892,7 +892,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, info->rti_flags & RTF_MPATH)) { if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(EEXIST); } @@ -929,7 +929,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, if (rt->rt_llinfo == NULL) { if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(ENOMEM); } @@ -999,7 +999,7 @@ rtrequest1(int req, struct rt_addrinfo *info, u_int8_t prio, rtfree(rt->rt_parent); if (rt->rt_gwroute) rtfree(rt->rt_gwroute); - free(rt_key(rt), M_RTABLE); + free(rt_key(rt), M_RTABLE, 0); pool_put(&rtentry_pool, rt); senderr(EEXIST); } @@ -1045,7 +1045,7 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate, memmove(rt->rt_gateway, gate, glen); if (old) { memmove(new, dst, dlen); - free(old, M_RTABLE); + free(old, M_RTABLE, 0); } if (rt->rt_gwroute != NULL) { RTFREE(rt->rt_gwroute); @@ -1372,7 +1372,7 @@ rt_timer_queue_destroy(struct rttimer_queue *rtq) } LIST_REMOVE(rtq, rtq_link); - free(rtq, M_RTABLE); + free(rtq, M_RTABLE, 0); } unsigned long @@ -1569,7 +1569,7 @@ rtlabel_unref(u_int16_t id) if (id == p->rtl_id) { if (--p->rtl_ref == 0) { TAILQ_REMOVE(&rt_labels, p, rtl_entry); - free(p, M_TEMP); + free(p, M_TEMP, 0); } break; } diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 3594b440369..834238dbcba 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.148 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: rtsock.c,v 1.149 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -156,7 +156,7 @@ route_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, else error = raw_attach(so, (int)(long)nam); if (error) { - free(rp, M_PCB); + free(rp, M_PCB, 0); splx(s); return (error); } @@ -718,7 +718,7 @@ report: goto flush; } memcpy(new_rtm, rtm, rtm->rtm_msglen); - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); rtm = new_rtm; } rt_msg2(rtm->rtm_type, RTM_VERSION, &info, (caddr_t)rtm, @@ -805,7 +805,7 @@ report: /* if gateway changed remove MPLS information */ if (rt->rt_llinfo != NULL && rt->rt_flags & RTF_MPLS) { - free(rt->rt_llinfo, M_TEMP); + free(rt->rt_llinfo, M_TEMP, 0); rt->rt_llinfo = NULL; rt->rt_flags &= ~RTF_MPLS; } @@ -863,7 +863,7 @@ flush: if (!(so->so_options & SO_USELOOPBACK)) { if (route_cb.any_count <= 1) { fail: - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); m_freem(m); return (error); } @@ -878,7 +878,7 @@ fail: m = NULL; } else if (m->m_pkthdr.len > rtm->rtm_msglen) m_adj(m, rtm->rtm_msglen - m->m_pkthdr.len); - free(rtm, M_RTABLE); + free(rtm, M_RTABLE, 0); } if (m) route_input(m, &route_proto, &route_src, &route_dst); @@ -1031,7 +1031,7 @@ again: rw->w_needed += len; if (rw->w_needed <= 0 && rw->w_where) { if (rw->w_tmemsize < len) { - free(rw->w_tmem, M_RTABLE); + free(rw->w_tmem, M_RTABLE, 0); rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT); if (rw->w_tmem) rw->w_tmemsize = len; @@ -1403,7 +1403,7 @@ sysctl_rtable(int *name, u_int namelen, void *where, size_t *given, void *new, return (error); } splx(s); - free(w.w_tmem, M_RTABLE); + free(w.w_tmem, M_RTABLE, 0); w.w_needed += w.w_given; if (where) { *given = w.w_where - (caddr_t)where; diff --git a/sys/net/trunklacp.c b/sys/net/trunklacp.c index b960d1fc207..c85f4b10a9b 100644 --- a/sys/net/trunklacp.c +++ b/sys/net/trunklacp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trunklacp.c,v 1.14 2012/12/05 23:20:23 deraadt Exp $ */ +/* $OpenBSD: trunklacp.c,v 1.15 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */ /* $FreeBSD:ieee8023ad_lacp.c,v 1.15 2008/03/16 19:25:30 thompsa Exp $ */ @@ -557,7 +557,7 @@ lacp_port_destroy(struct trunk_port *tp) lacp_unselect(lp); LIST_REMOVE(lp, lp_next); - free(lp, M_DEVBUF); + free(lp, M_DEVBUF, 0); } void @@ -760,7 +760,7 @@ lacp_detach(struct trunk_softc *sc) timeout_del(&lsc->lsc_transit_callout); timeout_del(&lsc->lsc_callout); - free(lsc, M_DEVBUF); + free(lsc, M_DEVBUF, 0); return (0); } @@ -1067,7 +1067,7 @@ lacp_aggregator_delref(struct lacp_softc *lsc, struct lacp_aggregator *la) TAILQ_REMOVE(&lsc->lsc_aggregators, la, la_q); - free(la, M_DEVBUF); + free(la, M_DEVBUF, 0); } /* diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index f6772cda9b6..fd7ac93392f 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto.c,v 1.61 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto.c,v 1.62 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> @@ -87,7 +87,7 @@ ieee80211_crypto_detach(struct ifnet *ifp) while ((pmk = TAILQ_FIRST(&ic->ic_pmksa)) != NULL) { TAILQ_REMOVE(&ic->ic_pmksa, pmk, pmk_next); explicit_bzero(pmk, sizeof(*pmk)); - free(pmk, M_DEVBUF); + free(pmk, M_DEVBUF, 0); } /* clear all group keys from memory */ diff --git a/sys/net80211/ieee80211_crypto_bip.c b/sys/net80211/ieee80211_crypto_bip.c index 7a5ea8d77a4..3b76c29972d 100644 --- a/sys/net80211/ieee80211_crypto_bip.c +++ b/sys/net80211/ieee80211_crypto_bip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_bip.c,v 1.4 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_bip.c,v 1.5 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> @@ -72,7 +72,7 @@ void ieee80211_bip_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index d081d64c851..72c55b4bc9d 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.13 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.14 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> @@ -70,7 +70,7 @@ void ieee80211_ccmp_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 5b260306a38..101212ad7a3 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.21 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.22 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> @@ -98,7 +98,7 @@ void ieee80211_tkip_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index c27710ed7be..8ba9e93c319 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_crypto_wep.c,v 1.9 2013/11/21 16:16:08 mpi Exp $ */ +/* $OpenBSD: ieee80211_crypto_wep.c,v 1.10 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> @@ -71,7 +71,7 @@ void ieee80211_wep_delete_key(struct ieee80211com *ic, struct ieee80211_key *k) { if (k->k_priv != NULL) - free(k->k_priv, M_DEVBUF); + free(k->k_priv, M_DEVBUF, 0); k->k_priv = NULL; } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 2a0a9c64443..6927f20f9fb 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.125 2014/07/11 08:19:40 blambert Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.126 2014/07/12 18:44:22 tedu Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -172,7 +172,7 @@ ieee80211_input_print_task(void *arg1, void *arg2) struct ieee80211printmsg *msg = arg1; printf("%s", msg->text); - free(msg, M_DEVBUF); + free(msg, M_DEVBUF, 0); } void @@ -1330,7 +1330,7 @@ ieee80211_save_ie(const u_int8_t *frm, u_int8_t **ie) { if (*ie == NULL || (*ie)[1] != frm[1]) { if (*ie != NULL) - free(*ie, M_DEVBUF); + free(*ie, M_DEVBUF, 0); *ie = malloc(2 + frm[1], M_DEVBUF, M_NOWAIT); if (*ie == NULL) return ENOMEM; @@ -2445,7 +2445,7 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, if (ic->ic_ampdu_rx_start != NULL && ic->ic_ampdu_rx_start(ic, ni, tid) != 0) { /* driver failed to setup, rollback */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; status = IEEE80211_STATUS_REFUSED; goto resp; @@ -2583,7 +2583,7 @@ ieee80211_recv_delba(struct ieee80211com *ic, struct mbuf *m, if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); /* free reordering buffer */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } else { diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 21f63d7e6b1..3318a718a91 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.c,v 1.80 2013/12/01 10:08:55 stsp Exp $ */ +/* $OpenBSD: ieee80211_node.c,v 1.81 2014/07/12 18:44:22 tedu Exp $ */ /* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */ /*- @@ -217,9 +217,9 @@ ieee80211_node_detach(struct ifnet *ifp) ieee80211_free_allnodes(ic); #ifndef IEEE80211_STA_ONLY if (ic->ic_aid_bitmap != NULL) - free(ic->ic_aid_bitmap, M_DEVBUF); + free(ic->ic_aid_bitmap, M_DEVBUF, 0); if (ic->ic_tim_bitmap != NULL) - free(ic->ic_tim_bitmap, M_DEVBUF); + free(ic->ic_tim_bitmap, M_DEVBUF, 0); timeout_del(&ic->ic_inact_timeout); timeout_del(&ic->ic_node_cache_timeout); #endif @@ -765,7 +765,7 @@ void ieee80211_node_cleanup(struct ieee80211com *ic, struct ieee80211_node *ni) { if (ni->ni_rsnie != NULL) { - free(ni->ni_rsnie, M_DEVBUF); + free(ni->ni_rsnie, M_DEVBUF, 0); ni->ni_rsnie = NULL; } } @@ -774,7 +774,7 @@ void ieee80211_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) { ieee80211_node_cleanup(ic, ni); - free(ni, M_DEVBUF); + free(ni, M_DEVBUF, 0); } void @@ -1501,7 +1501,7 @@ ieee80211_node_leave_ht(struct ieee80211com *ic, struct ieee80211_node *ni) for (i = 0; i < IEEE80211_BA_MAX_WINSZ; i++) if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index c20b4e49c03..e9cb889123c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.46 2012/01/18 14:35:56 stsp Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.47 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -660,7 +660,7 @@ ieee80211_delba_request(struct ieee80211com *ic, struct ieee80211_node *ni, if (ba->ba_buf[i].m != NULL) m_freem(ba->ba_buf[i].m); /* free reordering buffer */ - free(ba->ba_buf, M_DEVBUF); + free(ba->ba_buf, M_DEVBUF, 0); ba->ba_buf = NULL; } } diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index b3c7b813469..459a64c29f6 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.130 2014/07/12 14:26:00 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.131 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -271,7 +271,7 @@ arp_rtrequest(int req, struct rtentry *rt) la_hold_total--; m_freem(m); } - free(la, M_RTABLE); + free(la, M_RTABLE, 0); } } diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 8622e3a9853..a112ef2d6ea 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: igmp.c,v 1.41 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: igmp.c,v 1.42 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: igmp.c,v 1.15 1996/02/13 23:41:25 christos Exp $ */ /* @@ -202,7 +202,7 @@ rti_delete(struct ifnet *ifp) for (rti = rti_head; rti != 0; rti = rti->rti_next) { if (rti->rti_ifp == ifp) { *prti = rti->rti_next; - free(rti, M_MRTABLE); + free(rti, M_MRTABLE, 0); break; } prti = &rti->rti_next; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 70e1a8d4e67..acfa84755d9 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.100 2014/07/12 14:26:00 mpi Exp $ */ +/* $OpenBSD: in.c,v 1.101 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -1015,7 +1015,7 @@ in_addmulti(struct in_addr *ap, struct ifnet *ifp) */ memcpy(&ifr.ifr_addr, &inm->inm_sin, sizeof(inm->inm_sin)); if ((*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) { - free(inm, M_IPMADDR); + free(inm, M_IPMADDR, 0); return (NULL); } @@ -1068,7 +1068,7 @@ in_delmulti(struct in_multi *inm) splx(s); } - free(inm, M_IPMADDR); + free(inm, M_IPMADDR, 0); } } diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c index 8473c301549..296a689eeee 100644 --- a/sys/netinet/ip_ah.c +++ b/sys/netinet/ip_ah.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ah.c,v 1.109 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_ah.c,v 1.110 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -191,7 +191,7 @@ ah_zeroize(struct tdb *tdbp) if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } @@ -439,7 +439,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) /* Free, if we allocated. */ if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); return EINVAL; } @@ -460,7 +460,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) /* Free, if we allocated. */ if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); return EINVAL; } } @@ -524,7 +524,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) DPRINTF(("ah_massage_headers(): unexpected " "IPv6 header type %d\n", off)); if (alloc) - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); ahstat.ahs_hdrops++; m_freem(m); return EINVAL; @@ -535,7 +535,7 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out) if (alloc) { m_copyback(m, sizeof(struct ip6_hdr), skip - sizeof(struct ip6_hdr), ptr, M_NOWAIT); - free(ptr, M_XDATA); + free(ptr, M_XDATA, 0); } break; @@ -717,7 +717,7 @@ ah_input(struct mbuf *m, struct tdb *tdb, int skip, int protoff) if ((btsx = ah_massage_headers(&m, tdb->tdb_dst.sa.sa_family, skip, ahx->type, 0)) != 0) { /* mbuf will be free'd by callee. */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); return btsx; } @@ -774,7 +774,7 @@ ah_input_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; DPRINTF(("ah_input_cb(): bogus returned buffer from " @@ -786,7 +786,7 @@ ah_input_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_notdb++; DPRINTF(("ah_input_cb(): TDB is expired while in crypto")); error = EPERM; @@ -804,7 +804,7 @@ ah_input_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_noxform++; DPRINTF(("ah_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -828,7 +828,7 @@ ah_input_cb(void *op) /* Verify authenticator. */ if (timingsafe_bcmp(ptr + skip + rplen, calc, ahx->authsize)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); DPRINTF(("ah_input(): authentication failed for " "packet in SA %s/%08x\n", @@ -850,7 +850,7 @@ ah_input_cb(void *op) m_copyback(m, protoff, sizeof(u_int8_t), &prot, M_NOWAIT); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Replay window checking, if applicable. */ if (tdb->tdb_wnd > 0) { @@ -1243,7 +1243,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, if ((len = ah_massage_headers(&m, tdb->tdb_dst.sa.sa_family, skip, ahx->type, 1)) != 0) { /* mbuf will be free'd by callee. */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); return len; } @@ -1297,7 +1297,7 @@ ah_output_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ahstat.ahs_crypto++; DPRINTF(("ah_output_cb(): bogus returned buffer from " @@ -1309,7 +1309,7 @@ ah_output_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_notdb++; DPRINTF(("ah_output_cb(): TDB is expired while in crypto\n")); error = EPERM; @@ -1325,7 +1325,7 @@ ah_output_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ahstat.ahs_noxform++; DPRINTF(("ah_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -1339,7 +1339,7 @@ ah_output_cb(void *op) if ((tdb->tdb_flags & TDBF_SKIPCRYPTO) == 0) m_copyback(m, 0, skip, ptr, M_NOWAIT); - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* No longer needed. */ crypto_freereq(crp); diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 608205c1990..481fa36f0e6 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_carp.c,v 1.231 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_carp.c,v 1.232 2014/07/12 18:44:23 tedu Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff. All rights reserved. @@ -729,7 +729,7 @@ carp_clone_create(ifc, unit) LIST_INIT(&sc->carp_vhosts); sc->sc_vhe_count = 0; if (carp_new_vhost(sc, 0, 0)) { - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (ENOMEM); } @@ -817,8 +817,8 @@ carp_clone_destroy(struct ifnet *ifp) ether_ifdetach(ifp); if_detach(ifp); carp_destroy_vhosts(ifp->if_softc); - free(sc->sc_imo.imo_membership, M_IPMOPTS); - free(sc, M_DEVBUF); + free(sc->sc_imo.imo_membership, M_IPMOPTS, 0); + free(sc, M_DEVBUF, 0); return (0); } @@ -865,7 +865,7 @@ carpdetach(struct carp_softc *sc) if (!--cif->vhif_nvrs) { ifpromisc(sc->sc_carpdev, 0); sc->sc_carpdev->if_carp = NULL; - free(cif, M_IFADDR); + free(cif, M_IFADDR, 0); } } sc->sc_carpdev = NULL; @@ -893,7 +893,7 @@ carp_destroy_vhosts(struct carp_softc *sc) for (vhe = LIST_FIRST(&sc->carp_vhosts); vhe != NULL; vhe = nvhe) { nvhe = LIST_NEXT(vhe, vhost_entries); - free(vhe, M_DEVBUF); + free(vhe, M_DEVBUF, 0); } LIST_INIT(&sc->carp_vhosts); sc->sc_vhe_count = 0; @@ -1681,7 +1681,7 @@ carp_set_ifp(struct carp_softc *sc, struct ifnet *ifp) if (ncif == NULL) return (ENOBUFS); if ((error = ifpromisc(ifp, 1))) { - free(ncif, M_IFADDR); + free(ncif, M_IFADDR, 0); return (error); } @@ -2547,7 +2547,7 @@ carp_ether_addmulti(struct carp_softc *sc, struct ifreq *ifr) ioctl_failed: LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); alloc_failed: (void)ether_delmulti(ifr, (struct arpcom *)&sc->sc_ac); @@ -2594,7 +2594,7 @@ carp_ether_delmulti(struct carp_softc *sc, struct ifreq *ifr) if (error == 0) { /* And forget about this address. */ LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } else (void)ether_addmulti(ifr, (struct arpcom *)&sc->sc_ac); return (error); @@ -2626,6 +2626,6 @@ carp_ether_purgemulti(struct carp_softc *sc) memcpy(&ifr->ifr_addr, &mc->mc_addr, mc->mc_addr.ss_len); (void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr); LIST_REMOVE(mc, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } } diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index bf29436a217..62c53fffee3 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.124 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.125 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -304,13 +304,13 @@ esp_zeroize(struct tdb *tdbp) if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } if (tdbp->tdb_emxkey) { explicit_bzero(tdbp->tdb_emxkey, tdbp->tdb_emxkeylen); - free(tdbp->tdb_emxkey, M_XDATA); + free(tdbp->tdb_emxkey, M_XDATA, 0); tdbp->tdb_emxkey = NULL; } @@ -554,7 +554,7 @@ esp_input_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; DPRINTF(("esp_input_cb(): bogus returned buffer from crypto\n")); @@ -565,7 +565,7 @@ esp_input_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_notdb++; DPRINTF(("esp_input_cb(): TDB is expired while in crypto")); error = EPERM; @@ -583,7 +583,7 @@ esp_input_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_noxform++; DPRINTF(("esp_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; @@ -605,7 +605,7 @@ esp_input_cb(void *op) /* Verify authenticator */ if (timingsafe_bcmp(ptr, aalg, esph->authsize)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); DPRINTF(("esp_input_cb(): authentication failed for packet in SA %s/%08x\n", ipsp_address(tdb->tdb_dst), ntohl(tdb->tdb_spi))); espstat.esps_badauth++; error = EACCES; @@ -616,7 +616,7 @@ esp_input_cb(void *op) /* Remove trailing authenticator */ m_adj(m, -(esph->authsize)); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Replay window checking, if appropriate */ if (tdb->tdb_wnd > 0) { @@ -1059,7 +1059,7 @@ esp_output_cb(void *op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); espstat.esps_crypto++; DPRINTF(("esp_output_cb(): bogus returned buffer from " @@ -1072,7 +1072,7 @@ esp_output_cb(void *op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_notdb++; DPRINTF(("esp_output_cb(): TDB is expired while in crypto\n")); error = EPERM; @@ -1088,14 +1088,14 @@ esp_output_cb(void *op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); espstat.esps_noxform++; DPRINTF(("esp_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Release crypto descriptors. */ crypto_freereq(crp); diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c index 6e753eb8d51..021ff99c095 100644 --- a/sys/netinet/ip_ipcomp.c +++ b/sys/netinet/ip_ipcomp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipcomp.c,v 1.34 2014/07/09 09:30:49 henning Exp $ */ +/* $OpenBSD: ip_ipcomp.c,v 1.35 2014/07/12 18:44:23 tedu Exp $ */ /* * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org) @@ -230,7 +230,7 @@ ipcomp_input_cb(op) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; DPRINTF(("ipcomp_input_cb(): bogus returned buffer from crypto\n")); @@ -241,7 +241,7 @@ ipcomp_input_cb(op) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; DPRINTF(("ipcomp_input_cb(): TDB expired while in crypto")); error = EPERM; @@ -255,7 +255,7 @@ ipcomp_input_cb(op) /* Hard expiration */ if ((tdb->tdb_flags & TDBF_BYTES) && (tdb->tdb_cur_bytes >= tdb->tdb_exp_bytes)) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_HARD); tdb_delete(tdb); error = ENXIO; @@ -277,14 +277,14 @@ ipcomp_input_cb(op) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; DPRINTF(("ipcomp_input_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Length of data after processing */ clen = crp->crp_olen; @@ -573,7 +573,7 @@ ipcomp_output_cb(cp) m = (struct mbuf *) crp->crp_buf; if (m == NULL) { /* Shouldn't happen... */ - free(tc, M_XDATA); + free(tc, M_XDATA, 0); crypto_freereq(crp); ipcompstat.ipcomps_crypto++; DPRINTF(("ipcomp_output_cb(): bogus returned buffer from " @@ -585,7 +585,7 @@ ipcomp_output_cb(cp) tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto); if (tdb == NULL) { - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_notdb++; DPRINTF(("ipcomp_output_cb(): TDB expired while in crypto\n")); error = EPERM; @@ -601,14 +601,14 @@ ipcomp_output_cb(cp) splx(s); return crypto_dispatch(crp); } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); ipcompstat.ipcomps_noxform++; DPRINTF(("ipcomp_output_cb(): crypto error %d\n", crp->crp_etype)); error = crp->crp_etype; goto baddone; } - free(tc, M_XDATA); + free(tc, M_XDATA, 0); /* Check sizes. */ if (rlen < crp->crp_olen) { diff --git a/sys/netinet/ip_ipsp.c b/sys/netinet/ip_ipsp.c index 5835011215b..526d2e617b7 100644 --- a/sys/netinet/ip_ipsp.c +++ b/sys/netinet/ip_ipsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_ipsp.c,v 1.195 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ip_ipsp.c,v 1.196 2014/07/12 18:44:23 tedu Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr), @@ -638,13 +638,13 @@ tdb_rehash(void) } } - free(tdbh, M_TDB); + free(tdbh, M_TDB, 0); tdbh = new_tdbh; - free(tdbaddr, M_TDB); + free(tdbaddr, M_TDB, 0); tdbaddr = new_tdbaddr; - free(tdbsrc, M_TDB); + free(tdbsrc, M_TDB, 0); tdbsrc = new_srcaddr; } @@ -892,7 +892,7 @@ tdb_free(struct tdb *tdbp) if ((tdbp->tdb_inext) && (tdbp->tdb_inext->tdb_onext == tdbp)) tdbp->tdb_inext->tdb_onext = NULL; - free(tdbp, M_TDB); + free(tdbp, M_TDB, 0); } /* @@ -1049,7 +1049,7 @@ ipsp_reffree(struct ipsec_ref *ipr) ipr->ref_count, ipr, ipr->ref_len, ipr->ref_malloctype); #endif if (--ipr->ref_count <= 0) - free(ipr, ipr->ref_malloctype); + free(ipr, ipr->ref_malloctype, 0); } /* Mark a TDB as TDBF_SKIPCRYPTO. */ diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index d7afaf85743..f2583c987d6 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_mroute.c,v 1.66 2014/04/21 12:22:26 henning Exp $ */ +/* $OpenBSD: ip_mroute.c,v 1.67 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ip_mroute.c,v 1.85 2004/04/26 01:31:57 matt Exp $ */ /* @@ -604,7 +604,7 @@ ip_mrouter_done() } memset(nexpire, 0, sizeof(nexpire)); - free(mfchashtbl, M_MRTABLE); + free(mfchashtbl, M_MRTABLE, 0); mfchashtbl = NULL; bw_upcalls_n = 0; @@ -1021,11 +1021,11 @@ expire_mfc(struct mfc *rt) for (rte = rt->mfc_stall; rte != NULL; rte = nrte) { nrte = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); } LIST_REMOVE(rt, mfc_hash); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); } /* @@ -1118,7 +1118,7 @@ add_mfc(struct mbuf *m) ip_mdq(rte->m, rte->ifp, rt); } m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); } } } @@ -1215,7 +1215,7 @@ del_mfc(struct mbuf *m) rt->mfc_bw_meter = NULL; LIST_REMOVE(rt, mfc_hash); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return (0); @@ -1331,7 +1331,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) mb0 = m_copy(m, 0, M_COPYALL); M_PULLUP(mb0, hlen); if (mb0 == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); splx(s); return (ENOBUFS); } @@ -1392,9 +1392,9 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) "socket queue full\n"); ++mrtstat.mrts_upq_sockfull; fail1: - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); fail: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return (ENOBUFS); @@ -1437,7 +1437,7 @@ ip_mforward(struct mbuf *m, struct ifnet *ifp) if (++npkts > MAX_UPQ) { mrtstat.mrts_upq_ovflw++; non_fatal: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return (0); @@ -1487,7 +1487,7 @@ expire_upcalls(void *v) struct bw_meter *x = rt->mfc_bw_meter; rt->mfc_bw_meter = x->bm_mfc_next; - free(x, M_BWMETER); + free(x, M_BWMETER, 0); } ++mrtstat.mrts_cache_cleanups; @@ -1877,7 +1877,7 @@ free_bw_list(struct bw_meter *list) list = list->bm_mfc_next; unschedule_bw_meter(x); - free(x, M_BWMETER); + free(x, M_BWMETER, 0); } } @@ -1945,7 +1945,7 @@ del_bw_upcall(struct mbuf *m) unschedule_bw_meter(x); splx(s); /* Free the bw_meter entry */ - free(x, M_BWMETER); + free(x, M_BWMETER, 0); return (0); } else { splx(s); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index cbec4e7f983..eb7db875269 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.264 2014/07/11 15:25:44 henning Exp $ */ +/* $OpenBSD: ip_output.c,v 1.265 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -1238,7 +1238,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, if (ipr->ref_type < IPSP_IDENTITY_PREFIX || ipr->ref_type > IPSP_IDENTITY_CONNECTION || ((char *)(ipr + 1))[ipr->ref_len - 1]) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_srcid != NULL) @@ -1251,7 +1251,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, if (ipr->ref_type < IPSP_IDENTITY_PREFIX || ipr->ref_type > IPSP_IDENTITY_CONNECTION || ((char *)(ipr + 1))[ipr->ref_len - 1]) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_dstid != NULL) @@ -1262,7 +1262,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, case IP_IPSEC_LOCAL_CRED: if (ipr->ref_type < IPSP_CRED_KEYNOTE || ipr->ref_type > IPSP_CRED_X509) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_cred != NULL) @@ -1273,7 +1273,7 @@ ip_ctloutput(int op, struct socket *so, int level, int optname, case IP_IPSEC_LOCAL_AUTH: if (ipr->ref_type < IPSP_AUTH_PASSPHRASE || ipr->ref_type > IPSP_AUTH_RSA) { - free(ipr, M_CREDENTIALS); + free(ipr, M_CREDENTIALS, 0); error = EINVAL; } else { if (inp->inp_ipo->ipo_local_auth != NULL) @@ -1825,7 +1825,7 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, bcopy(omships, nmships, sizeof(*omships) * imo->imo_max_memberships); - free(omships, M_IPMOPTS); + free(omships, M_IPMOPTS, 0); imo->imo_membership = nmships; imo->imo_max_memberships = newmax; } @@ -1915,8 +1915,8 @@ ip_setmoptions(int optname, struct ip_moptions **imop, struct mbuf *m, imo->imo_multicast_ttl == IP_DEFAULT_MULTICAST_TTL && imo->imo_multicast_loop == IP_DEFAULT_MULTICAST_LOOP && imo->imo_num_memberships == 0) { - free(imo->imo_membership , M_IPMOPTS); - free(*imop, M_IPMOPTS); + free(imo->imo_membership , M_IPMOPTS, 0); + free(*imop, M_IPMOPTS, 0); *imop = NULL; } @@ -1980,8 +1980,8 @@ ip_freemoptions(struct ip_moptions *imo) if (imo != NULL) { for (i = 0; i < imo->imo_num_memberships; ++i) in_delmulti(imo->imo_membership[i]); - free(imo->imo_membership, M_IPMOPTS); - free(imo, M_IPMOPTS); + free(imo->imo_membership, M_IPMOPTS, 0); + free(imo, M_IPMOPTS, 0); } } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index e0e4773b69a..74d8d7264c9 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.129 2014/04/21 12:22:26 henning Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.130 2014/07/12 18:44:23 tedu Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -1012,7 +1012,7 @@ tcp_signature_tdb_zeroize(tdbp) { if (tdbp->tdb_amxkey) { explicit_bzero(tdbp->tdb_amxkey, tdbp->tdb_amxkeylen); - free(tdbp->tdb_amxkey, M_XDATA); + free(tdbp->tdb_amxkey, M_XDATA, 0); tdbp->tdb_amxkey = NULL; } diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index f27ce57ffbb..049147ae563 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.52 2014/04/14 09:06:42 mpi Exp $ */ +/* $OpenBSD: frag6.c,v 1.53 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -348,7 +348,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) /* dequeue the fragment. */ LIST_REMOVE(af6, ip6af_list); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); /* adjust pointer. */ ip6err = mtod(merr, struct ip6_hdr *); @@ -393,14 +393,14 @@ frag6_input(struct mbuf **mp, int *offp, int proto) ecn0 = (ntohl(af6->ip6af_flow) >> 20) & IPTOS_ECN_MASK; if (ecn == IPTOS_ECN_CE) { if (ecn0 == IPTOS_ECN_NOTECT) { - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto dropfrag; } if (ecn0 != IPTOS_ECN_CE) af6->ip6af_flow |= htonl(IPTOS_ECN_CE << 20); } if (ecn == IPTOS_ECN_NOTECT && ecn0 != IPTOS_ECN_NOTECT) { - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto dropfrag; } @@ -429,7 +429,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, inet_ntop(AF_INET6, &q6->ip6q_src, ip, sizeof(ip))); #endif - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto flushfrags; } } @@ -443,7 +443,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) i, inet_ntop(AF_INET6, &q6->ip6q_src, ip, sizeof(ip))); #endif - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); goto flushfrags; } } @@ -494,12 +494,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto) t = t->m_next; t->m_next = IP6_REASS_MBUF(af6); m_adj(t->m_next, af6->ip6af_offset); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } /* adjust offset to point where the original next header starts */ offset = ip6af->ip6af_offset - sizeof(struct ip6_frag); - free(ip6af, M_FTABLE); + free(ip6af, M_FTABLE, 0); ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_plen = htons((u_short)next + offset - sizeof(struct ip6_hdr)); ip6->ip6_src = q6->ip6q_src; @@ -510,7 +510,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) if (frag6_deletefraghdr(m, offset) != 0) { TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; goto dropfrag; } @@ -525,7 +525,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ @@ -552,12 +552,12 @@ frag6_input(struct mbuf **mp, int *offp, int proto) while ((af6 = LIST_FIRST(&q6->ip6q_asfrag)) != NULL) { LIST_REMOVE(af6, ip6af_list); m_freem(IP6_REASS_MBUF(af6)); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } ip6stat.ip6s_fragdropped += q6->ip6q_nfrag; TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; dropfrag: @@ -626,11 +626,11 @@ frag6_freef(struct ip6q *q6) ICMP6_TIME_EXCEED_REASSEMBLY, 0); } else m_freem(m); - free(af6, M_FTABLE); + free(af6, M_FTABLE, 0); } TAILQ_REMOVE(&frag6_queue, q6, ip6q_queue); frag6_nfrags -= q6->ip6q_nfrag; - free(q6, M_FTABLE); + free(q6, M_FTABLE, 0); frag6_nfragpackets--; } diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index 200265196d3..e9670897dda 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in6.c,v 1.137 2014/05/15 09:05:13 mpi Exp $ */ +/* $OpenBSD: in6.c,v 1.138 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */ /* @@ -1459,7 +1459,7 @@ in6_addmulti(struct in6_addr *maddr6, struct ifnet *ifp, int *errorp) memcpy(&ifr.ifr_addr, &in6m->in6m_sin, sizeof(in6m->in6m_sin)); *errorp = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr); if (*errorp) { - free(in6m, M_IPMADDR); + free(in6m, M_IPMADDR, 0); return (NULL); } @@ -1513,7 +1513,7 @@ in6_delmulti(struct in6_multi *in6m) splx(s); } - free(in6m, M_IPMADDR); + free(in6m, M_IPMADDR, 0); } } @@ -1530,7 +1530,7 @@ in6_joingroup(struct ifnet *ifp, struct in6_addr *addr, int *errorp) imm->i6mm_maddr = in6_addmulti(addr, ifp, errorp); if (!imm->i6mm_maddr) { /* *errorp is alrady set */ - free(imm, M_IPMADDR); + free(imm, M_IPMADDR, 0); return NULL; } return imm; @@ -1542,7 +1542,7 @@ in6_leavegroup(struct in6_multi_mship *imm) if (imm->i6mm_maddr) in6_delmulti(imm->i6mm_maddr); - free(imm, M_IPMADDR); + free(imm, M_IPMADDR, 0); return 0; } @@ -2169,7 +2169,7 @@ in6_domifdetach(struct ifnet *ifp, void *aux) struct in6_ifextra *ext = (struct in6_ifextra *)aux; nd6_ifdetach(ext->nd_ifinfo); - free(ext->in6_ifstat, M_IFADDR); - free(ext->icmp6_ifstat, M_IFADDR); - free(ext, M_IFADDR); + free(ext->in6_ifstat, M_IFADDR, 0); + free(ext->icmp6_ifstat, M_IFADDR, 0); + free(ext, M_IFADDR, 0); } diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index e2b66ff2af9..60128a14fee 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -497,12 +497,12 @@ ip6_mrouter_done(void) struct rtdetq *n = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } frt = rt; rt = rt->mf6c_next; - free(frt, M_MRTABLE); + free(frt, M_MRTABLE, 0); } } @@ -793,7 +793,7 @@ add_m6fc(struct mf6cctl *mfccp) ip6_mdq(rte->m, rte->ifp, rt); } m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } rt->mf6c_stall = NULL; @@ -915,7 +915,7 @@ del_m6fc(struct mf6cctl *mfccp) } *nptr = rt->mf6c_next; - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); @@ -1042,7 +1042,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) (M_READONLY(mb0) || mb0->m_len < sizeof(struct ip6_hdr))) mb0 = m_pullup(mb0, sizeof(struct ip6_hdr)); if (mb0 == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1065,7 +1065,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE, M_NOWAIT); if (rt == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return ENOBUFS; @@ -1077,9 +1077,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) mm = m_copy(mb0, 0, sizeof(struct ip6_hdr)); if (mm == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1100,9 +1100,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) im->im6_mbz = 0; break; default: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return EINVAL; } @@ -1128,9 +1128,9 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) log(LOG_WARNING, "ip6_mforward: ip6_mrouter " "socket queue full\n"); mrt6stat.mrt6s_upq_sockfull++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE, 0); splx(s); return ENOBUFS; } @@ -1162,7 +1162,7 @@ ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next) if (++npkts > MAX_UPQ6) { mrt6stat.mrt6s_upq_ovflw++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); m_freem(mb0); splx(s); return 0; @@ -1229,14 +1229,14 @@ expire_upcalls(void *unused) do { struct rtdetq *n = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE, 0); rte = n; } while (rte != NULL); mrt6stat.mrt6s_cache_cleanups++; n6expire[i]--; *nptr = mfc->mf6c_next; - free(mfc, M_MRTABLE); + free(mfc, M_MRTABLE, 0); } else { nptr = &mfc->mf6c_next; } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index d9355271a7b..70d28f0883a 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.156 2014/04/21 11:10:54 henning Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.157 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -2097,7 +2097,7 @@ ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, struct socket *so) * Only turning off any previous options, regardless of * whether the opt is just created or given. */ - free(opt, M_IP6OPT); + free(opt, M_IP6OPT, 0); return (0); } @@ -2107,7 +2107,7 @@ ip6_pcbopts(struct ip6_pktopts **pktopt, struct mbuf *m, struct socket *so) if ((error = ip6_setpktopts(m, opt, NULL, priv, so->so_proto->pr_protocol)) != 0) { ip6_clearpktopts(opt, -1); /* XXX discard all options */ - free(opt, M_IP6OPT); + free(opt, M_IP6OPT, 0); return (error); } *pktopt = opt; @@ -2247,7 +2247,7 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) { if (optname == -1 || optname == IPV6_PKTINFO) { if (pktopt->ip6po_pktinfo) - free(pktopt->ip6po_pktinfo, M_IP6OPT); + free(pktopt->ip6po_pktinfo, M_IP6OPT, 0); pktopt->ip6po_pktinfo = NULL; } if (optname == -1 || optname == IPV6_HOPLIMIT) @@ -2260,22 +2260,22 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) pktopt->ip6po_nextroute.ro_rt = NULL; } if (pktopt->ip6po_nexthop) - free(pktopt->ip6po_nexthop, M_IP6OPT); + free(pktopt->ip6po_nexthop, M_IP6OPT, 0); pktopt->ip6po_nexthop = NULL; } if (optname == -1 || optname == IPV6_HOPOPTS) { if (pktopt->ip6po_hbh) - free(pktopt->ip6po_hbh, M_IP6OPT); + free(pktopt->ip6po_hbh, M_IP6OPT, 0); pktopt->ip6po_hbh = NULL; } if (optname == -1 || optname == IPV6_RTHDRDSTOPTS) { if (pktopt->ip6po_dest1) - free(pktopt->ip6po_dest1, M_IP6OPT); + free(pktopt->ip6po_dest1, M_IP6OPT, 0); pktopt->ip6po_dest1 = NULL; } if (optname == -1 || optname == IPV6_RTHDR) { if (pktopt->ip6po_rhinfo.ip6po_rhi_rthdr) - free(pktopt->ip6po_rhinfo.ip6po_rhi_rthdr, M_IP6OPT); + free(pktopt->ip6po_rhinfo.ip6po_rhi_rthdr, M_IP6OPT, 0); pktopt->ip6po_rhinfo.ip6po_rhi_rthdr = NULL; if (pktopt->ip6po_route.ro_rt) { RTFREE(pktopt->ip6po_route.ro_rt); @@ -2284,7 +2284,7 @@ ip6_clearpktopts(struct ip6_pktopts *pktopt, int optname) } if (optname == -1 || optname == IPV6_DSTOPTS) { if (pktopt->ip6po_dest2) - free(pktopt->ip6po_dest2, M_IP6OPT); + free(pktopt->ip6po_dest2, M_IP6OPT, 0); pktopt->ip6po_dest2 = NULL; } } @@ -2341,7 +2341,7 @@ ip6_freepcbopts(struct ip6_pktopts *pktopt) ip6_clearpktopts(pktopt, -1); - free(pktopt, M_IP6OPT); + free(pktopt, M_IP6OPT, 0); } /* @@ -2617,7 +2617,7 @@ ip6_setmoptions(int optname, struct ip6_moptions **im6op, struct mbuf *m) im6o->im6o_multicast_hlim == ip6_defmcasthlim && im6o->im6o_multicast_loop == IPV6_DEFAULT_MULTICAST_LOOP && LIST_EMPTY(&im6o->im6o_memberships)) { - free(*im6op, M_IPMOPTS); + free(*im6op, M_IPMOPTS, 0); *im6op = NULL; } @@ -2684,7 +2684,7 @@ ip6_freemoptions(struct ip6_moptions *im6o) LIST_REMOVE(imm, i6mm_chain); in6_leavegroup(imm); } - free(im6o, M_IPMOPTS); + free(im6o, M_IPMOPTS, 0); } /* diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 596f52db93e..044a6ea123d 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6.c,v 1.119 2014/07/11 16:39:06 henning Exp $ */ +/* $OpenBSD: nd6.c,v 1.120 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */ /* @@ -165,7 +165,7 @@ void nd6_ifdetach(struct nd_ifinfo *nd) { - free(nd, M_IP6NDP); + free(nd, M_IP6NDP, 0); } void @@ -1226,7 +1226,7 @@ nd6_rtrequest(int req, struct rtentry *rt) rt->rt_flags &= ~RTF_LLINFO; if (ln->ln_hold) m_freem(ln->ln_hold); - free(ln, M_RTABLE); + free(ln, M_RTABLE, 0); } } @@ -1920,7 +1920,7 @@ nd6_sysctl(int name, void *oldp, size_t *oldlenp, void *newp, size_t newlen) break; } if (p) - free(p, M_TEMP); + free(p, M_TEMP, 0); return (error); } diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 04981ba73f1..c8a3e543c2f 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_nbr.c,v 1.79 2014/06/07 11:04:14 henning Exp $ */ +/* $OpenBSD: nd6_nbr.c,v 1.80 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */ /* @@ -1226,7 +1226,7 @@ nd6_dad_stop(struct ifaddr *ifa) nd6_dad_stoptimer(dp); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1275,7 +1275,7 @@ nd6_dad_timer(struct ifaddr *ifa) ifa->ifa_ifp->if_xname)); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1330,7 +1330,7 @@ nd6_dad_timer(struct ifaddr *ifa) addr, sizeof(addr)))); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; @@ -1373,7 +1373,7 @@ nd6_dad_duplicated(struct ifaddr *ifa) ifa->ifa_ifp->if_xname); TAILQ_REMOVE(&dadq, (struct dadq *)dp, dad_list); - free(dp, M_IP6NDP); + free(dp, M_IP6NDP, 0); dp = NULL; ifafree(ifa); ip6_dad_pending--; diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index c277734167c..e8a7b10d487 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nd6_rtr.c,v 1.82 2014/07/11 16:39:06 henning Exp $ */ +/* $OpenBSD: nd6_rtr.c,v 1.83 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */ /* @@ -515,7 +515,7 @@ defrtrlist_del(struct nd_defrouter *dr) dr->ifp->if_xname); } - free(dr, M_IP6NDP); + free(dr, M_IP6NDP, 0); } /* @@ -859,7 +859,7 @@ void pfxrtr_del(struct nd_pfxrouter *pfr) { LIST_REMOVE(pfr, pfr_entry); - free(pfr, M_IP6NDP); + free(pfr, M_IP6NDP, 0); } struct nd_prefix * @@ -1011,7 +1011,7 @@ prelist_remove(struct nd_prefix *pr) /* free list of routers that adversed the prefix */ LIST_FOREACH_SAFE(pfr, &pr->ndpr_advrtrs, pfr_entry, next) - free(pfr, M_IP6NDP); + free(pfr, M_IP6NDP, 0); ext->nprefixes--; if (ext->nprefixes < 0) { @@ -1020,7 +1020,7 @@ prelist_remove(struct nd_prefix *pr) } splx(s); - free(pr, M_IP6NDP); + free(pr, M_IP6NDP, 0); pfxlist_onlink_check(); } diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 281ddc77ba9..a8198f7e451 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip6.c,v 1.66 2014/04/18 10:48:30 jca Exp $ */ +/* $OpenBSD: raw_ip6.c,v 1.67 2014/07/12 18:44:23 tedu Exp $ */ /* $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $ */ /* @@ -651,7 +651,7 @@ rip6_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, ip6_mrouter_done(); #endif if (in6p->inp_icmp6filt) { - free(in6p->inp_icmp6filt, M_PCB); + free(in6p->inp_icmp6filt, M_PCB, 0); in6p->inp_icmp6filt = NULL; } in_pcbdetach(in6p); diff --git a/sys/nfs/nfs_aiod.c b/sys/nfs/nfs_aiod.c index ada3669560e..0f002b666e9 100644 --- a/sys/nfs/nfs_aiod.c +++ b/sys/nfs/nfs_aiod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_aiod.c,v 1.5 2013/11/03 13:50:24 miod Exp $ */ +/* $OpenBSD: nfs_aiod.c,v 1.6 2014/07/12 18:43:52 tedu Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -147,7 +147,7 @@ loop: /* Loop around until SIGKILL */ goto loop; out1: - free(aiod, M_TEMP); + free(aiod, M_TEMP, 0); nfs_numaiods--; KASSERT(nfs_numaiods >= 0); /* Rejust the limit of bufs to queue. See comment above. */ diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index e42dae30f25..aac0be74626 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.19 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.20 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -203,7 +203,7 @@ filt_nfsdetach(struct knote *kn) } else { /* last user, g/c */ SLIST_REMOVE(&kevlist, ke, kevq, kev_link); - free(ke, M_KEVENT); + free(ke, M_KEVENT, 0); } break; } diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 9c7efe60679..7f86e51fac8 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.55 2010/12/21 20:14:43 thib Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.56 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -199,7 +199,7 @@ nfs_inactive(void *v) nfs_removeit(sp); crfree(sp->s_cred); vrele(sp->s_dvp); - free(sp, M_NFSREQ); + free(sp, M_NFSREQ, 0); } np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT); diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 84b8201d03e..3704086d4ee 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.96 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.97 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */ /* @@ -633,7 +633,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, uiop->uio_segflg = UIO_SYSSPACE; error = VOP_READ(vp, uiop, IO_NODELOCKED, cred); off = uiop->uio_offset; - free(iv2, M_TEMP); + free(iv2, M_TEMP, 0); if (error || (getret = VOP_GETATTR(vp, &va, cred, procp)) != 0){ if (!error) error = getret; @@ -798,7 +798,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, uiop->uio_offset = off; error = VOP_WRITE(vp, uiop, ioflags, cred); nfsstats.srvvop_writes++; - free(iv, M_TEMP); + free(iv, M_TEMP, 0); } aftat_ret = VOP_GETATTR(vp, &va, cred, procp); vput(vp); @@ -1727,7 +1727,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, } out: if (pathcp) - free(pathcp, M_TEMP); + free(pathcp, M_TEMP, 0); if (dirp) { diraft_ret = VOP_GETATTR(dirp, &diraft, cred, procp); vrele(dirp); @@ -1758,7 +1758,7 @@ nfsmout: if (nd.ni_vp) vrele(nd.ni_vp); if (pathcp) - free(pathcp, M_TEMP); + free(pathcp, M_TEMP, 0); return (error); } @@ -2102,7 +2102,7 @@ again: VOP_UNLOCK(vp, 0, procp); if (error) { vrele(vp); - free((caddr_t)rbuf, M_TEMP); + free((caddr_t)rbuf, M_TEMP, 0); nfsm_reply(NFSX_POSTOPATTR(info.nmi_v3)); nfsm_srvpostop_attr(nfsd, getret, &at, &info); error = 0; @@ -2128,7 +2128,7 @@ again: tl = nfsm_build(&info.nmi_mb, 2 * NFSX_UNSIGNED); *tl++ = nfs_false; *tl = nfs_true; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); error = 0; goto nfsmout; } @@ -2206,7 +2206,7 @@ again: *tl = nfs_true; else *tl = nfs_false; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); nfsmout: return(error); } @@ -2301,7 +2301,7 @@ again: error = getret; if (error) { vrele(vp); - free((caddr_t)rbuf, M_TEMP); + free((caddr_t)rbuf, M_TEMP, 0); nfsm_reply(NFSX_V3POSTOPATTR); nfsm_srvpostop_attr(nfsd, getret, &at, &info); error = 0; @@ -2324,7 +2324,7 @@ again: tl += 2; *tl++ = nfs_false; *tl = nfs_true; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); error = 0; goto nfsmout; } @@ -2448,7 +2448,7 @@ invalid: *tl = nfs_true; else *tl = nfs_false; - free(rbuf, M_TEMP); + free(rbuf, M_TEMP, 0); nfsmout: return(error); } diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index c8d336b2479..ebda87e6479 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_srvcache.c,v 1.23 2009/06/04 18:36:43 thib Exp $ */ +/* $OpenBSD: nfs_srvcache.c,v 1.24 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */ /* @@ -262,7 +262,7 @@ nfsrv_cleancache(void) LIST_REMOVE(rp, rc_hash); TAILQ_REMOVE(&nfsrvlruhead, rp, rc_lru); nfsrv_cleanentry(rp); - free(rp, M_NFSD); + free(rp, M_NFSD, 0); } numnfsrvcache = 0; } diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index af87e03e058..84c3216f535 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_syscalls.c,v 1.96 2013/11/03 13:50:24 miod Exp $ */ +/* $OpenBSD: nfs_syscalls.c,v 1.97 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */ /* @@ -456,7 +456,7 @@ loop: done: TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain); splx(s); - free((caddr_t)nfsd, M_NFSD); + free((caddr_t)nfsd, M_NFSD, 0); if (--nfs_numnfsd == 0) nfsrv_init(1); /* Reinitialize everything */ return (error); @@ -506,7 +506,7 @@ nfsrv_slpderef(struct nfssvc_sock *slp) { if (--(slp->ns_sref) == 0 && (slp->ns_flag & SLP_VALID) == 0) { TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain); - free((caddr_t)slp, M_NFSSVC); + free((caddr_t)slp, M_NFSSVC, 0); } } @@ -530,7 +530,7 @@ nfsrv_init(int terminating) if (slp->ns_flag & SLP_VALID) nfsrv_zapsock(slp); TAILQ_REMOVE(&nfssvc_sockhead, slp, ns_chain); - free((caddr_t)slp, M_NFSSVC); + free((caddr_t)slp, M_NFSSVC, 0); } nfsrv_cleancache(); /* And clear out server cache */ } diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index a9d441a552f..f955f17a60c 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vfsops.c,v 1.99 2013/12/01 16:40:56 krw Exp $ */ +/* $OpenBSD: nfs_vfsops.c,v 1.100 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */ /* @@ -678,7 +678,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct mbuf *nam, return (0); bad: nfs_disconnect(nmp); - free((caddr_t)nmp, M_NFSMNT); + free((caddr_t)nmp, M_NFSMNT, 0); m_freem(nam); return (error); } @@ -703,7 +703,7 @@ nfs_unmount(struct mount *mp, int mntflags, struct proc *p) nfs_disconnect(nmp); m_freem(nmp->nm_nam); timeout_del(&nmp->nm_rtimeout); - free(nmp, M_NFSMNT); + free(nmp, M_NFSMNT, 0); return (0); } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index fc708ae0f2c..35593451ccf 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.151 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.152 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -2040,7 +2040,7 @@ nfs_readdir(void *v) } } while (!error && !done && !eof && cnt--); - free(data, M_TEMP); + free(data, M_TEMP, 0); data = NULL; uio->uio_offset = newoff; @@ -2538,7 +2538,7 @@ nfs_sillyrename(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) bad: vrele(sp->s_dvp); crfree(sp->s_cred); - free(sp, M_NFSREQ); + free(sp, M_NFSREQ, 0); return (error); } diff --git a/sys/ntfs/ntfs_ihash.c b/sys/ntfs/ntfs_ihash.c index ecf3064087a..3c53d6a6501 100644 --- a/sys/ntfs/ntfs_ihash.c +++ b/sys/ntfs/ntfs_ihash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_ihash.c,v 1.14 2014/01/19 18:35:45 tedu Exp $ */ +/* $OpenBSD: ntfs_ihash.c,v 1.15 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: ntfs_ihash.c,v 1.1 2002/12/23 17:38:32 jdolecek Exp $ */ /* @@ -68,7 +68,7 @@ ntfs_nthashinit(void) nthashtbl = hashinit(desiredvnodes, M_NTFSNTHASH, M_WAITOK, &nthash); if (ntfs_nthashtbl) { - free(nthashtbl, M_NTFSNTHASH); + free(nthashtbl, M_NTFSNTHASH, 0); return; } ntfs_nthashtbl = nthashtbl; diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c index 31bb58534cb..963ed7f4735 100644 --- a/sys/ntfs/ntfs_subr.c +++ b/sys/ntfs/ntfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_subr.c,v 1.37 2014/01/19 18:35:45 tedu Exp $ */ +/* $OpenBSD: ntfs_subr.c,v 1.38 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */ /*- @@ -241,7 +241,7 @@ ntfs_ntvattrget(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t type, "name: %.*s, vcn: %llu\n", ip->i_number, type, (unsigned int)namelen, name, vcn); out: - free(alpool, M_TEMP); + free(alpool, M_TEMP, 0); return (error); } @@ -354,7 +354,7 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip) ntmp->ntm_ntnodes++; out: - free(mfrp, M_TEMP); + free(mfrp, M_TEMP, 0); return (error); } @@ -476,7 +476,7 @@ ntfs_ntput(struct ntnode *ip, struct proc *p) } vrele(ip->i_devvp); - free(ip, M_NTFSNTNODE); + free(ip, M_NTFSNTNODE, 0); } /* @@ -515,14 +515,14 @@ ntfs_freentvattr(struct ntvattr *vap) { if (vap->va_flag & NTFS_AF_INRUN) { if (vap->va_vruncn) - free(vap->va_vruncn, M_NTFSRUN); + free(vap->va_vruncn, M_NTFSRUN, 0); if (vap->va_vruncl) - free(vap->va_vruncl, M_NTFSRUN); + free(vap->va_vruncl, M_NTFSRUN, 0); } else { if (vap->va_datap) - free(vap->va_datap, M_NTFSRDATA); + free(vap->va_datap, M_NTFSRDATA, 0); } - free(vap, M_NTFSNTVATTR); + free(vap, M_NTFSNTVATTR, 0); } /* @@ -582,7 +582,7 @@ ntfs_attrtontvattr(struct ntfsmount *ntmp, struct ntvattr **rvapp, DDPRINTF(", len: %llu", vap->va_datalen); if (error) - free(vap, M_NTFSNTVATTR); + free(vap, M_NTFSNTVATTR, 0); else *rvapp = vap; @@ -762,10 +762,10 @@ ntfs_frele(struct fnode *fp) DPRINTF("ntfs_frele: deallocating fnode\n"); LIST_REMOVE(fp,f_fnlist); if (fp->f_flag & FN_AATTRNAME) - free(fp->f_attrname, M_TEMP); + free(fp->f_attrname, M_TEMP, 0); if (fp->f_dirblbuf) - free(fp->f_dirblbuf, M_NTFSDIR); - free(fp, M_NTFSFNODE); + free(fp->f_dirblbuf, M_NTFSDIR, 0); + free(fp, M_NTFSFNODE, 0); ntfs_ntrele(ip); } @@ -955,7 +955,7 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp, struct vnode *vp, /* free the buffer returned by ntfs_ntlookupattr() */ if (attrname) { - free(attrname, M_TEMP); + free(attrname, M_TEMP, 0); attrname = NULL; } @@ -1048,7 +1048,7 @@ ntfs_ntlookupfile(struct ntfsmount *ntmp, struct vnode *vp, tctx = lookup_ctx; lookup_ctx = lookup_ctx->prev; - free(tctx, M_TEMP); + free(tctx, M_TEMP, 0); } else { DPRINTF("ntfs_ntlookupfile: nowhere to dive :-(\n"); error = ENOENT; @@ -1072,14 +1072,14 @@ fail: if (vap) ntfs_ntvattrrele(vap); if (rdbuf) - free(rdbuf, M_TEMP); + free(rdbuf, M_TEMP, 0); if (attrname) - free(attrname, M_TEMP); + free(attrname, M_TEMP, 0); if (lookup_ctx) { while(lookup_ctx) { tctx = lookup_ctx; lookup_ctx = lookup_ctx->prev; - free(tctx, M_TEMP); + free(tctx, M_TEMP, 0); } } ntfs_ntput(ip, p); @@ -1272,7 +1272,7 @@ fail: if (iavap) ntfs_ntvattrrele(iavap); if (bmp) - free(bmp, M_TEMP); + free(bmp, M_TEMP, 0); ntfs_ntput(ip, p); return (error); @@ -1744,8 +1744,8 @@ ntfs_readattr(struct ntfsmount *ntmp, struct ntnode *ip, u_int32_t attrnum, cn += NTFS_COMPUNIT_CL; } - free(uup, M_NTFSDECOMP); - free(cup, M_NTFSDECOMP); + free(uup, M_NTFSDECOMP, 0); + free(cup, M_NTFSDECOMP, 0); } else error = ntfs_readattr_plain(ntmp, ip, attrnum, attrname, roff, rsize, rdata, &init, uio); @@ -1927,7 +1927,7 @@ ntfs_toupper_unuse(struct proc *p) ntfs_toupper_usecount--; if (ntfs_toupper_usecount == 0) { - free(ntfs_toupper_tab, M_NTFSRDATA); + free(ntfs_toupper_tab, M_NTFSRDATA, 0); ntfs_toupper_tab = NULL; } #ifdef DIAGNOSTIC diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c index e128580677f..11d2da2976c 100644 --- a/sys/ntfs/ntfs_vfsops.c +++ b/sys/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vfsops.c,v 1.39 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ntfs_vfsops.c,v 1.40 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */ /*- @@ -457,8 +457,8 @@ out: if (ntmp != NULL) { if (ntmp->ntm_ad != NULL) - free(ntmp->ntm_ad, M_NTFSMNT); - free(ntmp, M_NTFSMNT); + free(ntmp->ntm_ad, M_NTFSMNT, 0); + free(ntmp, M_NTFSMNT, 0); mp->mnt_data = NULL; } @@ -536,8 +536,8 @@ ntfs_unmount(struct mount *mp, int mntflags, struct proc *p) DPRINTF("ntfs_unmount: freeing memory...\n"); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - free(ntmp->ntm_ad, M_NTFSMNT); - free(ntmp, M_NTFSMNT); + free(ntmp->ntm_ad, M_NTFSMNT, 0); + free(ntmp, M_NTFSMNT, 0); return (error); } @@ -595,7 +595,7 @@ ntfs_calccfree(struct ntfsmount *ntmp, cn_t *cfreep) *cfreep = cfree; out: - free(tmp, M_TEMP); + free(tmp, M_TEMP, 0); return(error); } diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c index 2da5a8043ae..b8277cfdb0a 100644 --- a/sys/ntfs/ntfs_vnops.c +++ b/sys/ntfs/ntfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vnops.c,v 1.35 2013/12/14 02:57:25 guenther Exp $ */ +/* $OpenBSD: ntfs_vnops.c,v 1.36 2014/07/12 18:43:52 tedu Exp $ */ /* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */ /* @@ -576,7 +576,7 @@ ntfs_readdir(void *v) */ out: if (fp->f_dirblbuf != NULL) { - free(fp->f_dirblbuf, M_NTFSDIR); + free(fp->f_dirblbuf, M_NTFSDIR, 0); fp->f_dirblbuf = NULL; } return (error); diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 58bf24cac5f..6943a86c773 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.h,v 1.110 2014/07/12 10:51:35 tedu Exp $ */ +/* $OpenBSD: malloc.h,v 1.111 2014/07/12 18:43:32 tedu Exp $ */ /* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */ /* @@ -393,7 +393,7 @@ extern struct kmembuckets bucket[]; void *malloc(size_t, int, int); void *mallocarray(size_t, size_t, int, int); -void free(void *, int); +void free(void *, int, size_t); int sysctl_malloc(int *, u_int, void *, size_t *, void *, size_t, struct proc *); diff --git a/sys/ufs/ext2fs/ext2fs_inode.c b/sys/ufs/ext2fs/ext2fs_inode.c index 5e260310687..4722b30788e 100644 --- a/sys/ufs/ext2fs/ext2fs_inode.c +++ b/sys/ufs/ext2fs/ext2fs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_inode.c,v 1.51 2014/07/11 14:30:52 pelikan Exp $ */ +/* $OpenBSD: ext2fs_inode.c,v 1.52 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_inode.c,v 1.24 2001/06/19 12:59:18 wiz Exp $ */ /* @@ -519,7 +519,7 @@ ext2fs_indirtrunc(struct inode *ip, int32_t lbn, int32_t dbn, int32_t lastbn, in } if (copy != NULL) { - free(copy, M_TEMP); + free(copy, M_TEMP, 0); } else { bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/ufs/ext2fs/ext2fs_lookup.c b/sys/ufs/ext2fs/ext2fs_lookup.c index 1c478a48854..af3f89059f8 100644 --- a/sys/ufs/ext2fs/ext2fs_lookup.c +++ b/sys/ufs/ext2fs/ext2fs_lookup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_lookup.c,v 1.34 2014/07/12 10:55:33 pelikan Exp $ */ +/* $OpenBSD: ext2fs_lookup.c,v 1.35 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_lookup.c,v 1.16 2000/08/03 20:29:26 thorpej Exp $ */ /* @@ -188,7 +188,7 @@ ext2fs_readdir(void *v) /* we need to correct uio_offset */ uio->uio_offset = off; } - free(dirbuf, M_TEMP); + free(dirbuf, M_TEMP, 0); *ap->a_eofflag = ext2fs_size(VTOI(ap->a_vp)) <= uio->uio_offset; return (error); } diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 5fc43e38516..7bfe1f3c9d4 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.78 2014/07/12 13:23:59 pelikan Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.79 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -132,7 +132,7 @@ ext2fs_mountroot(void) if ((error = ext2fs_mountfs(rootvp, mp, p)) != 0) { mp->mnt_vfc->vfc_refcount--; vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); vrele(rootvp); return (error); } @@ -416,7 +416,7 @@ e2fs_sbfill(struct vnode *devvp, struct m_ext2fs *fs, struct ext2fs *sb) error = bread(devvp, fsbtodb(fs, dblk), fs->e2fs_bsize, &bp); if (error) { - free(fs->e2fs_gd, M_UFSMNT); + free(fs->e2fs_gd, M_UFSMNT, 0); fs->e2fs_gd = NULL; brelse(bp); return (error); @@ -598,8 +598,8 @@ out: (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p); VOP_UNLOCK(devvp, 0, p); if (ump) { - free(ump->um_e2fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(ump->um_e2fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; } return (error); @@ -635,9 +635,9 @@ ext2fs_unmount(struct mount *mp, int mntflags, struct proc *p) error = VOP_CLOSE(ump->um_devvp, fs->e2fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); vput(ump->um_devvp); - free(fs->e2fs_gd, M_UFSMNT); - free(fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(fs->e2fs_gd, M_UFSMNT, 0); + free(fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; mp->mnt_flag &= ~MNT_LOCAL; return (error); diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index cc34620e32b..28c8212971c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_inode.c,v 1.70 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ffs_inode.c,v 1.71 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ffs_inode.c,v 1.10 1996/05/11 18:27:19 mycroft Exp $ */ /* @@ -561,7 +561,7 @@ ffs_indirtrunc(struct inode *ip, daddr_t lbn, daddr_t dbn, } } if (copy != NULL) { - free(copy, M_TEMP); + free(copy, M_TEMP, 0); } else { bp->b_flags |= B_INVAL; brelse(bp); diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index d29df5de4f7..3caf5b6ea5c 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.127 2014/05/22 02:02:39 guenther Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.128 2014/07/12 18:44:01 tedu Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -2288,7 +2288,7 @@ check_inode_unwritten(struct inodedep *inodedep) if (inodedep->id_state & ONWORKLIST) WORKLIST_REMOVE(&inodedep->id_list); if (inodedep->id_savedino1 != NULL) { - free(inodedep->id_savedino1, M_INODEDEP); + free(inodedep->id_savedino1, M_INODEDEP, 0); inodedep->id_savedino1 = NULL; } if (free_inodedep(inodedep) == 0) { @@ -3826,7 +3826,7 @@ softdep_disk_write_complete(struct buf *bp) if (indirdep->ir_state & GOINGAWAY) panic("disk_write_complete: indirdep gone"); memcpy(bp->b_data, indirdep->ir_saveddata, bp->b_bcount); - free(indirdep->ir_saveddata, M_INDIRDEP); + free(indirdep->ir_saveddata, M_INDIRDEP, 0); indirdep->ir_saveddata = NULL; indirdep->ir_state &= ~UNDONE; indirdep->ir_state |= ATTACHED; @@ -4015,7 +4015,7 @@ handle_written_inodeblock(struct inodedep *inodedep, struct buf *bp) *dp1 = *inodedep->id_savedino1; else *dp2 = *inodedep->id_savedino2; - free(inodedep->id_savedino1, M_INODEDEP); + free(inodedep->id_savedino1, M_INODEDEP, 0); inodedep->id_savedino1 = NULL; if ((bp->b_flags & B_DELWRI) == 0) stat_inode_bitmap++; diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index ba4e887615d..40be455808e 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vfsops.c,v 1.140 2013/12/12 19:00:10 tedu Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.141 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -139,7 +139,7 @@ ffs_mountroot(void) if ((error = ffs_mountfs(rootvp, mp, p)) != 0) { mp->mnt_vfc->vfc_refcount--; vfs_unbusy(mp); - free(mp, M_MOUNT); + free(mp, M_MOUNT, 0); vrele(swapdev_vp); vrele(rootvp); return (error); @@ -436,7 +436,7 @@ success: fs->fs_clean = ronly && (fs->fs_flags & FS_UNCLEAN) == 0 ? 1 : 0; if (ronly) - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_contigdirs, M_UFSMNT, 0); } if (!ronly) { if (mp->mnt_flag & MNT_SOFTDEP) @@ -809,7 +809,7 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) size = (blks - i) * fs->fs_fsize; error = bread(devvp, fsbtodb(fs, fs->fs_csaddr + i), size, &bp); if (error) { - free(fs->fs_csp, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); goto out; } memcpy(space, bp->b_data, size); @@ -882,8 +882,8 @@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) if (ronly == 0) { if ((fs->fs_flags & FS_DOSOFTDEP) && (error = softdep_mount(devvp, mp, fs, cred)) != 0) { - free(fs->fs_csp, M_UFSMNT); - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); + free(fs->fs_contigdirs, M_UFSMNT, 0); goto out; } fs->fs_fmod = 1; @@ -907,8 +907,8 @@ out: VOP_UNLOCK(devvp, 0, p); if (ump) { - free(ump->um_fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(ump->um_fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; } return (error); @@ -1017,7 +1017,7 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p) fs->fs_clean = 0; return (error); } - free(fs->fs_contigdirs, M_UFSMNT); + free(fs->fs_contigdirs, M_UFSMNT, 0); } ump->um_devvp->v_specmountpoint = NULL; @@ -1026,9 +1026,9 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p) error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE, NOCRED, p); vput(ump->um_devvp); - free(fs->fs_csp, M_UFSMNT); - free(fs, M_UFSMNT); - free(ump, M_UFSMNT); + free(fs->fs_csp, M_UFSMNT, 0); + free(fs, M_UFSMNT, 0); + free(ump, M_UFSMNT, 0); mp->mnt_data = (qaddr_t)0; mp->mnt_flag &= ~MNT_LOCAL; return (error); diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index b66a95f29d6..c4a3b07c2b1 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vnops.c,v 1.44 2013/01/15 11:20:55 jsing Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.45 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */ /* @@ -250,7 +250,7 @@ mfs_reclaim(void *v) struct vop_reclaim_args *ap = v; struct vnode *vp = ap->a_vp; - free(vp->v_data, M_MFSNODE); + free(vp->v_data, M_MFSNODE, 0); vp->v_data = NULL; return (0); } diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 77f6e94dc59..62d2c49455b 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_dirhash.c,v 1.25 2013/12/12 19:15:32 tedu Exp $ */ +/* $OpenBSD: ufs_dirhash.c,v 1.26 2014/07/12 18:44:01 tedu Exp $ */ /* * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. * @@ -246,11 +246,11 @@ fail: for (i = 0; i < narrays; i++) if (dh->dh_hash[i] != NULL) DIRHASH_BLKFREE(dh->dh_hash[i]); - free(dh->dh_hash, M_DIRHASH); + free(dh->dh_hash, M_DIRHASH, 0); } if (dh->dh_blkfree != NULL) - free(dh->dh_blkfree, M_DIRHASH); - free(dh, M_DIRHASH); + free(dh->dh_blkfree, M_DIRHASH, 0); + free(dh, M_DIRHASH, 0); ip->i_dirhash = NULL; DIRHASHLIST_LOCK(); ufs_dirhashmem -= memreqd; @@ -282,13 +282,13 @@ ufsdirhash_free(struct inode *ip) if (dh->dh_hash != NULL) { for (i = 0; i < dh->dh_narrays; i++) DIRHASH_BLKFREE(dh->dh_hash[i]); - free(dh->dh_hash, M_DIRHASH); - free(dh->dh_blkfree, M_DIRHASH); + free(dh->dh_hash, M_DIRHASH, 0); + free(dh->dh_blkfree, M_DIRHASH, 0); mem += dh->dh_narrays * sizeof(*dh->dh_hash) + dh->dh_narrays * DH_NBLKOFF * sizeof(**dh->dh_hash) + dh->dh_nblk * sizeof(*dh->dh_blkfree); } - free(dh, M_DIRHASH); + free(dh, M_DIRHASH, 0); ip->i_dirhash = NULL; DIRHASHLIST_LOCK(); @@ -1042,8 +1042,8 @@ ufsdirhash_recycle(int wanted) DIRHASHLIST_UNLOCK(); for (i = 0; i < narrays; i++) DIRHASH_BLKFREE(hash[i]); - free(hash, M_DIRHASH); - free(blkfree, M_DIRHASH); + free(hash, M_DIRHASH, 0); + free(blkfree, M_DIRHASH, 0); /* Account for the returned memory, and repeat if necessary. */ DIRHASHLIST_LOCK(); diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 40d9ec225de..0afb4baefc8 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.114 2014/07/08 17:19:26 deraadt Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.115 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -1514,7 +1514,7 @@ ufs_readdir(void *v) if ((char *)dp + offsetof(struct direct, d_name) < edp && dp->d_reclen <= offsetof(struct direct, d_name)) error = EIO; - free(diskbuf, M_TEMP); + free(diskbuf, M_TEMP, 0); uio->uio_offset = off; *ap->a_eofflag = DIP(VTOI(ap->a_vp), size) <= off; diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c index df147a42736..77ec30cde1b 100644 --- a/sys/uvm/uvm_amap.c +++ b/sys/uvm/uvm_amap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_amap.c,v 1.52 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_amap.c,v 1.53 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */ /* @@ -238,10 +238,10 @@ amap_free(struct vm_amap *amap) KASSERT(amap->am_ref == 0 && amap->am_nused == 0); KASSERT((amap->am_flags & AMAP_SWAPOFF) == 0); - free(amap->am_slots, M_UVMAMAP); + free(amap->am_slots, M_UVMAMAP, 0); #ifdef UVM_AMAP_PPREF if (amap->am_ppref && amap->am_ppref != PPREF_NONE) - free(amap->am_ppref, M_UVMAMAP); + free(amap->am_ppref, M_UVMAMAP, 0); #endif pool_put(&uvm_amap_pool, amap); @@ -333,7 +333,7 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) M_WAITOK | M_CANFAIL); if (newppref == NULL) { /* give up if malloc fails */ - free(amap->am_ppref, M_UVMAMAP); + free(amap->am_ppref, M_UVMAMAP, 0); amap->am_ppref = PPREF_NONE; } } @@ -343,7 +343,7 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) if (newsl == NULL) { #ifdef UVM_AMAP_PPREF if (newppref != NULL) { - free(newppref, M_UVMAMAP); + free(newppref, M_UVMAMAP, 0); } #endif return (ENOMEM); @@ -394,10 +394,10 @@ amap_extend(struct vm_map_entry *entry, vsize_t addsize) amap->am_maxslot = slotalloc; /* and free */ - free(oldsl, M_UVMAMAP); + free(oldsl, M_UVMAMAP, 0); #ifdef UVM_AMAP_PPREF if (oldppref && oldppref != PPREF_NONE) - free(oldppref, M_UVMAMAP); + free(oldppref, M_UVMAMAP, 0); #endif return (0); } diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index b8fedc79a13..c658c075b91 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.66 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.67 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -379,7 +379,7 @@ uao_free(struct uvm_aobj *aobj) pool_put(&uao_swhash_elt_pool, elt); } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); } else { int i; @@ -393,7 +393,7 @@ uao_free(struct uvm_aobj *aobj) uvmexp.swpgonly--; } } - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); } /* finally free the aobj itself */ @@ -461,7 +461,7 @@ uao_shrink_hash(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swhash = new_swhash; aobj->u_pages = pages; @@ -498,7 +498,7 @@ uao_shrink_convert(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -522,7 +522,7 @@ uao_shrink_array(struct uvm_object *uobj, int pages) for (i = 0; i < pages; i++) new_swslots[i] = aobj->u_swslots[i]; - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -575,7 +575,7 @@ uao_grow_array(struct uvm_object *uobj, int pages) for (i = 0; i < aobj->u_pages; i++) new_swslots[i] = aobj->u_swslots[i]; - free(aobj->u_swslots, M_UVMAOBJ); + free(aobj->u_swslots, M_UVMAOBJ, 0); aobj->u_swslots = new_swslots; aobj->u_pages = pages; @@ -618,7 +618,7 @@ uao_grow_hash(struct uvm_object *uobj, int pages) } } - free(aobj->u_swhash, M_UVMAOBJ); + free(aobj->u_swhash, M_UVMAOBJ, 0); aobj->u_swhash = new_swhash; aobj->u_pages = pages; @@ -654,7 +654,7 @@ uao_grow_convert(struct uvm_object *uobj, int pages) } } - free(old_swslots, M_UVMAOBJ); + free(old_swslots, M_UVMAOBJ, 0); aobj->u_pages = pages; return 0; diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index b605886d313..1fe2e5ef38a 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.c,v 1.47 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.48 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $ */ /* @@ -187,7 +187,7 @@ udv_attach(dev_t device, vm_prot_t accessprot, voff_t off, vsize_t size) */ if (lcv) { mtx_leave(&udv_lock); - free(udv, M_TEMP); + free(udv, M_TEMP, 0); continue; } @@ -254,7 +254,7 @@ again: if (udv->u_flags & UVM_DEVICE_WANTED) wakeup(udv); mtx_leave(&udv_lock); - free(udv, M_TEMP); + free(udv, M_TEMP, 0); } diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c index 9f9049cb978..702b3bfe307 100644 --- a/sys/uvm/uvm_map.c +++ b/sys/uvm/uvm_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.c,v 1.170 2014/07/11 16:35:40 jsg Exp $ */ +/* $OpenBSD: uvm_map.c,v 1.171 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */ /* @@ -3685,7 +3685,7 @@ uvm_map_deallocate(vm_map_t map) TRUE, FALSE); pmap_destroy(map->pmap); KASSERT(RB_EMPTY(&map->addr)); - free(map, M_VMMAP); + free(map, M_VMMAP, 0); uvm_unmap_detach(&dead, 0); } diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c index a8cdb821721..d3d545f4e6e 100644 --- a/sys/uvm/uvm_mmap.c +++ b/sys/uvm/uvm_mmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_mmap.c,v 1.97 2014/07/08 11:38:48 deraadt Exp $ */ +/* $OpenBSD: uvm_mmap.c,v 1.98 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */ /* @@ -211,7 +211,7 @@ sys_mincore(struct proc *p, void *v, register_t *retval) * storing the status byte for a page. */ if ((error = uvm_vslock(p, vec, npgs, VM_PROT_WRITE)) != 0) { - free(pgs, M_TEMP); + free(pgs, M_TEMP, 0); return (error); } @@ -292,7 +292,7 @@ sys_mincore(struct proc *p, void *v, register_t *retval) /* now the map is unlocked we can copyout without fear. */ if (error == 0) copyout(pgs, vec, npgs * sizeof(char)); - free(pgs, M_TEMP); + free(pgs, M_TEMP, 0); return (error); } diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index 9929b576f3a..f80cae56cea 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.127 2014/05/08 20:08:50 kettenis Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.128 2014/07/12 18:44:01 tedu Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -497,7 +497,7 @@ swaplist_insert(struct swapdev *sdp, struct swappri *newspp, int priority) LIST_INSERT_HEAD(&swap_priority, spp, spi_swappri); } else { /* we don't need a new priority structure, free it */ - free(newspp, M_VMSWAP); + free(newspp, M_VMSWAP, 0); } /* @@ -555,7 +555,7 @@ swaplist_trim(void) if (!TAILQ_EMPTY(&spp->spi_swapdev)) continue; LIST_REMOVE(spp, spi_swappri); - free(spp, M_VMSWAP); + free(spp, M_VMSWAP, 0); } } @@ -728,7 +728,7 @@ sys_swapctl(struct proc *p, void *v, register_t *retval) swaplist_trim(); } if (error) - free(spp, M_VMSWAP); + free(spp, M_VMSWAP, 0); break; case SWAP_ON: /* @@ -775,8 +775,8 @@ sys_swapctl(struct proc *p, void *v, register_t *retval) if (vp->v_type == VREG) { crfree(sdp->swd_cred); } - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); break; } break; @@ -1052,7 +1052,7 @@ swap_off(struct proc *p, struct swapdev *sdp) extent_free(swapmap, sdp->swd_drumoffset, sdp->swd_drumsize, EX_WAITOK); extent_destroy(sdp->swd_ex); - free(sdp, M_VMSWAP); + free(sdp, M_VMSWAP, 0); return (0); } @@ -1909,9 +1909,9 @@ swapmount(void) } else #endif if (bdevvp(swap_dev, &vp)) { - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); - free(spp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); + free(spp, M_VMSWAP, 0); return; } @@ -1934,8 +1934,8 @@ gotit: swaplist_find(vp, 1); swaplist_trim(); vput(sdp->swd_vp); - free(sdp->swd_path, M_VMSWAP); - free(sdp, M_VMSWAP); + free(sdp->swd_path, M_VMSWAP, 0); + free(sdp, M_VMSWAP, 0); return; } } |