diff options
Diffstat (limited to 'sys/dev/pci')
78 files changed, 388 insertions, 388 deletions
diff --git a/sys/dev/pci/agp.c b/sys/dev/pci/agp.c index 7661a60dabb..3b515a2ca6a 100644 --- a/sys/dev/pci/agp.c +++ b/sys/dev/pci/agp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp.c,v 1.43 2014/03/26 14:41:41 mpi Exp $ */ +/* $OpenBSD: agp.c,v 1.44 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2000 Doug Rabson * All rights reserved. @@ -240,7 +240,7 @@ agp_alloc_gatt(bus_dma_tag_t dmat, u_int32_t apsize) if (agp_alloc_dmamem(dmat, gatt->ag_size, &gatt->ag_dmamap, &gatt->ag_physical, &gatt->ag_dmaseg) != 0) { - free(gatt, M_AGP); + free(gatt, M_AGP, 0); return (NULL); } @@ -248,7 +248,7 @@ agp_alloc_gatt(bus_dma_tag_t dmat, u_int32_t apsize) (caddr_t *)&gatt->ag_virtual, BUS_DMA_NOWAIT) != 0) { agp_free_dmamem(dmat, gatt->ag_size, gatt->ag_dmamap, &gatt->ag_dmaseg); - free(gatt, M_AGP); + free(gatt, M_AGP, 0); return (NULL); } @@ -262,7 +262,7 @@ agp_free_gatt(bus_dma_tag_t dmat, struct agp_gatt *gatt) { bus_dmamem_unmap(dmat, (caddr_t)gatt->ag_virtual, gatt->ag_size); agp_free_dmamem(dmat, gatt->ag_size, gatt->ag_dmamap, &gatt->ag_dmaseg); - free(gatt, M_AGP); + free(gatt, M_AGP, 0); } int @@ -340,7 +340,7 @@ agp_generic_alloc_memory(struct agp_softc *sc, int type, vsize_t size) if (bus_dmamap_create(sc->sc_dmat, size, size / PAGE_SIZE + 1, size, 0, BUS_DMA_NOWAIT, &mem->am_dmamap) != 0) { - free(mem, M_AGP); + free(mem, M_AGP, 0); return (NULL); } @@ -361,7 +361,7 @@ agp_generic_free_memory(struct agp_softc *sc, struct agp_memory *mem) sc->sc_allocated -= mem->am_size; TAILQ_REMOVE(&sc->sc_memory, mem, am_link); bus_dmamap_destroy(sc->sc_dmat, mem->am_dmamap); - free(mem, M_AGP); + free(mem, M_AGP, 0); return (0); } @@ -401,7 +401,7 @@ agp_generic_bind_memory(struct agp_softc *sc, struct agp_memory *mem, segs = malloc(nseg * sizeof *segs, M_AGP, M_WAITOK); if ((error = bus_dmamem_alloc(sc->sc_dmat, mem->am_size, PAGE_SIZE, 0, segs, nseg, &mem->am_nseg, BUS_DMA_ZERO | BUS_DMA_WAITOK)) != 0) { - free(segs, M_AGP); + free(segs, M_AGP, 0); rw_exit_write(&sc->sc_lock); AGP_DPF("bus_dmamem_alloc failed %d\n", error); return (error); @@ -409,7 +409,7 @@ agp_generic_bind_memory(struct agp_softc *sc, struct agp_memory *mem, if ((error = bus_dmamap_load_raw(sc->sc_dmat, mem->am_dmamap, segs, mem->am_nseg, mem->am_size, BUS_DMA_WAITOK)) != 0) { bus_dmamem_free(sc->sc_dmat, segs, mem->am_nseg); - free(segs, M_AGP); + free(segs, M_AGP, 0); rw_exit_write(&sc->sc_lock); AGP_DPF("bus_dmamap_load failed %d\n", error); return (error); @@ -488,7 +488,7 @@ agp_generic_unbind_memory(struct agp_softc *sc, struct agp_memory *mem) bus_dmamap_unload(sc->sc_dmat, mem->am_dmamap); bus_dmamem_free(sc->sc_dmat, mem->am_dmaseg, mem->am_nseg); - free(mem->am_dmaseg, M_AGP); + free(mem->am_dmaseg, M_AGP, 0); mem->am_offset = 0; mem->am_is_bound = 0; diff --git a/sys/dev/pci/agp_amd.c b/sys/dev/pci/agp_amd.c index f04f984401d..e87b5b8b569 100644 --- a/sys/dev/pci/agp_amd.c +++ b/sys/dev/pci/agp_amd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_amd.c,v 1.19 2014/05/27 12:40:00 kettenis Exp $ */ +/* $OpenBSD: agp_amd.c,v 1.20 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: agp_amd.c,v 1.6 2001/10/06 02:48:50 thorpej Exp $ */ /*- @@ -119,7 +119,7 @@ agp_amd_alloc_gatt(bus_dma_tag_t dmat, bus_size_t apsize) if (agp_alloc_dmamem(dmat, gatt->ag_size, &gatt->ag_dmamap, &gatt->ag_pdir, &gatt->ag_dmaseg) != 0) { printf("failed to allocate GATT\n"); - free(gatt, M_AGP); + free(gatt, M_AGP, 0); return (NULL); } @@ -128,7 +128,7 @@ agp_amd_alloc_gatt(bus_dma_tag_t dmat, bus_size_t apsize) printf("failed to map GATT\n"); agp_free_dmamem(dmat, gatt->ag_size, gatt->ag_dmamap, &gatt->ag_dmaseg); - free(gatt, M_AGP); + free(gatt, M_AGP, 0); return (NULL); } diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c index 8ba5968e236..4d33120f4b2 100644 --- a/sys/dev/pci/agp_i810.c +++ b/sys/dev/pci/agp_i810.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_i810.c,v 1.86 2014/05/12 19:29:16 kettenis Exp $ */ +/* $OpenBSD: agp_i810.c,v 1.87 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2000 Doug Rabson @@ -509,7 +509,7 @@ out: if (isc->gatt->ag_size != 0) agp_free_dmamem(pa->pa_dmat, isc->gatt->ag_size, isc->gatt->ag_dmamap, &isc->gatt->ag_dmaseg); - free(isc->gatt, M_AGP); + free(isc->gatt, M_AGP, 0); } if (isc->gtt_map != NULL) vga_pci_bar_unmap(isc->gtt_map); @@ -645,14 +645,14 @@ agp_i810_alloc_memory(void *softc, int type, vsize_t size) */ if ((mem->am_dmaseg = malloc(sizeof (*mem->am_dmaseg), M_AGP, M_WAITOK | M_CANFAIL)) == NULL) { - free(mem, M_AGP); + free(mem, M_AGP, 0); return (NULL); } if ((error = agp_alloc_dmamem(sc->sc_dmat, size, &mem->am_dmamap, &mem->am_physical, mem->am_dmaseg)) != 0) { - free(mem->am_dmaseg, M_AGP); - free(mem, M_AGP); + free(mem->am_dmaseg, M_AGP, 0); + free(mem, M_AGP, 0); printf("agp: agp_alloc_dmamem(%d)\n", error); return (NULL); } @@ -660,7 +660,7 @@ agp_i810_alloc_memory(void *softc, int type, vsize_t size) if ((error = bus_dmamap_create(sc->sc_dmat, size, size / PAGE_SIZE + 1, size, 0, BUS_DMA_NOWAIT, &mem->am_dmamap)) != 0) { - free(mem, M_AGP); + free(mem, M_AGP, 0); printf("agp: bus_dmamap_create(%d)\n", error); return (NULL); } @@ -684,14 +684,14 @@ agp_i810_free_memory(void *softc, struct agp_memory *mem) if (mem->am_type == 2) { agp_free_dmamem(sc->sc_dmat, mem->am_size, mem->am_dmamap, mem->am_dmaseg); - free(mem->am_dmaseg, M_AGP); + free(mem->am_dmaseg, M_AGP, 0); } else if (mem->am_type != 1) { bus_dmamap_destroy(sc->sc_dmat, mem->am_dmamap); } sc->sc_allocated -= mem->am_size; TAILQ_REMOVE(&sc->sc_memory, mem, am_link); - free(mem, M_AGP); + free(mem, M_AGP, 0); return (0); } diff --git a/sys/dev/pci/ahd_pci.c b/sys/dev/pci/ahd_pci.c index a05f87f32c6..0711e3332a1 100644 --- a/sys/dev/pci/ahd_pci.c +++ b/sys/dev/pci/ahd_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahd_pci.c,v 1.23 2013/11/18 17:40:39 guenther Exp $ */ +/* $OpenBSD: ahd_pci.c,v 1.24 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -771,7 +771,7 @@ ahd_check_extport(struct ahd_softc *ahd) ahd->flags |= AHD_USEDEFAULTS; error = ahd_default_config(ahd); adapter_control = CFAUTOTERM|CFSEAUTOTERM; - free(ahd->seep_config, M_DEVBUF); + free(ahd->seep_config, M_DEVBUF, 0); ahd->seep_config = NULL; } else { error = ahd_parse_cfgdata(ahd, sc); diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index 2d9d041d66f..bc569d83b96 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.101 2014/02/08 16:02:42 chris Exp $ */ +/* $OpenBSD: arc.c,v 1.102 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -1935,7 +1935,7 @@ arc_bio_alarm_state(struct arc_softc *sc, struct bioc_alarm *ba) ba->ba_status = sysinfo->alarm; out: - free(sysinfo, M_TEMP); + free(sysinfo, M_TEMP, 0); return (error); } @@ -1994,8 +1994,8 @@ arc_bio_inq(struct arc_softc *sc, struct bioc_inq *bi) DPRINTF("%s: volume set number = %d\n", DEVNAME(sc), nvols); out: arc_unlock(sc); - free(volinfo, M_TEMP); - free(sysinfo, M_TEMP); + free(volinfo, M_TEMP, 0); + free(sysinfo, M_TEMP, 0); return (error); } @@ -2078,7 +2078,7 @@ arc_bio_getvol(struct arc_softc *sc, int vol, struct arc_fw_volinfo *volinfo) } out: - free(sysinfo, M_TEMP); + free(sysinfo, M_TEMP, 0); return (error); } @@ -2158,7 +2158,7 @@ arc_bio_vol(struct arc_softc *sc, struct bioc_vol *bv) } out: - free(volinfo, M_TEMP); + free(volinfo, M_TEMP, 0); return (error); } @@ -2247,9 +2247,9 @@ arc_bio_disk(struct arc_softc *sc, struct bioc_disk *bd) out: arc_unlock(sc); - free(diskinfo, M_TEMP); - free(raidinfo, M_TEMP); - free(volinfo, M_TEMP); + free(diskinfo, M_TEMP, 0); + free(raidinfo, M_TEMP, 0); + free(volinfo, M_TEMP, 0); return (error); } @@ -2500,8 +2500,8 @@ arc_msgbuf(struct arc_softc *sc, void *wptr, size_t wbuflen, void *rptr, } out: - free(wbuf, M_TEMP); - free(rbuf, M_TEMP); + free(wbuf, M_TEMP, 0); + free(rbuf, M_TEMP, 0); return (error); } @@ -2651,7 +2651,7 @@ arc_create_sensors(void *xsc, void *arg) return; bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); } void @@ -2855,7 +2855,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, adm->adm_map); admfree: - free(adm, M_DEVBUF); + free(adm, M_DEVBUF, 0); return (NULL); } @@ -2867,7 +2867,7 @@ arc_dmamem_free(struct arc_softc *sc, struct arc_dmamem *adm) bus_dmamem_unmap(sc->sc_dmat, adm->adm_kva, adm->adm_size); bus_dmamem_free(sc->sc_dmat, &adm->adm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, adm->adm_map); - free(adm, M_DEVBUF); + free(adm, M_DEVBUF, 0); } int @@ -2937,7 +2937,7 @@ free_maps: arc_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -2950,7 +2950,7 @@ arc_free_ccb_src(struct arc_softc *sc) while ((ccb = arc_get_ccb(sc)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); arc_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); } struct arc_ccb * diff --git a/sys/dev/pci/auacer.c b/sys/dev/pci/auacer.c index 652ac84a05c..c929479cfa5 100644 --- a/sys/dev/pci/auacer.c +++ b/sys/dev/pci/auacer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auacer.c,v 1.15 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: auacer.c,v 1.16 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: auacer.c,v 1.3 2004/11/10 04:20:26 kent Exp $ */ /*- @@ -770,7 +770,7 @@ auacer_allocm(void *v, int direction, size_t size, int pool, int flags) error = auacer_allocmem(sc, size, PAGE_SIZE, p); if (error) { - free(p, pool); + free(p, pool, 0); return (NULL); } @@ -790,7 +790,7 @@ auacer_freem(void *v, void *ptr, int pool) if (KERNADDR(p) == ptr) { auacer_freemem(sc, p); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/auglx.c b/sys/dev/pci/auglx.c index 734c7dbf7a1..3b679f1e3e9 100644 --- a/sys/dev/pci/auglx.c +++ b/sys/dev/pci/auglx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auglx.c,v 1.11 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: auglx.c,v 1.12 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org> @@ -989,7 +989,7 @@ auglx_allocm(void *v, int direction, size_t size, int pool, int flags) error = auglx_allocmem(sc, size, PAGE_SIZE, p); if (error) { - free(p, pool); + free(p, pool, 0); return NULL; } @@ -1010,7 +1010,7 @@ auglx_freem(void *v, void *ptr, int pool) if (p->addr == ptr) { auglx_freemem(sc, p); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c index 80d59fbfa1c..691d3171b17 100644 --- a/sys/dev/pci/auich.c +++ b/sys/dev/pci/auich.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auich.c,v 1.100 2014/05/17 12:40:25 ratchov Exp $ */ +/* $OpenBSD: auich.c,v 1.101 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2000,2001 Michael Shalayeff @@ -1308,7 +1308,7 @@ auich_allocm(void *v, int direction, size_t size, int pool, int flags) error = auich_allocmem(sc, size, PAGE_SIZE, p); if (error) { - free(p, pool); + free(p, pool, 0); return NULL; } @@ -1339,7 +1339,7 @@ auich_freem(void *v, void *ptr, int pool) return; auich_freemem(sc, p); - free(p, pool); + free(p, pool, 0); } size_t diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 1be68a34e62..f4e30ba11ec 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.32 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: auixp.c,v 1.33 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -651,7 +651,7 @@ auixp_malloc(void *hdl, int direction, size_t size, int pool, int flags) /* get us a dma buffer itself */ error = auixp_allocmem(sc, size, 16, dma); if (error) { - free(dma, pool); + free(dma, pool, 0); printf("%s: auixp_malloc: not enough memory\n", sc->sc_dev.dv_xname); return NULL; @@ -684,7 +684,7 @@ auixp_free(void *hdl, void *addr, int pool) SLIST_REMOVE(&sc->sc_dma_list, dma, auixp_dma, dma_chain); auixp_freemem(sc, dma); - free(dma, pool); + free(dma, pool, 0); return; } } @@ -824,7 +824,7 @@ auixp_allocate_dma_chain(struct auixp_softc *sc, struct auixp_dma **dmap) if (error) { printf("%s: can't malloc dma descriptor chain\n", sc->sc_dev.dv_xname); - free(dma, M_DEVBUF); + free(dma, M_DEVBUF, 0); return ENOMEM; } diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index 9650e049ee2..50d11713885 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autri.c,v 1.35 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: autri.c,v 1.36 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro. @@ -1134,7 +1134,7 @@ autri_malloc(void *addr, int direction, size_t size, int pool, int flags) #endif error = autri_allocmem(sc, size, 0x10000, p); if (error) { - free(p, pool); + free(p, pool, 0); return NULL; } @@ -1153,7 +1153,7 @@ autri_free(void *addr, void *ptr, int pool) if (KERNADDR(p) == ptr) { autri_freemem(sc, p); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c index 196a96d495f..dabd03a72d7 100644 --- a/sys/dev/pci/auvia.c +++ b/sys/dev/pci/auvia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auvia.c,v 1.52 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: auvia.c,v 1.53 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: auvia.c,v 1.28 2002/11/04 16:38:49 kent Exp $ */ /*- @@ -914,7 +914,7 @@ fail_create: fail_map: bus_dmamem_free(sc->sc_dmat, &p->seg, 1); fail_alloc: - free(p, pool); + free(p, pool, 0); return 0; } @@ -933,7 +933,7 @@ auvia_free(void *addr, void *ptr, int pool) bus_dmamem_free(sc->sc_dmat, &p->seg, 1); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index b169827132d..2882f55a622 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.213 2014/07/10 14:21:20 deraadt Exp $ */ +/* $OpenBSD: azalia.c,v 1.214 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -628,7 +628,7 @@ azalia_pci_detach(struct device *self, int flags) } az->ncodecs = 0; if (az->codecs != NULL) { - free(az->codecs, M_DEVBUF); + free(az->codecs, M_DEVBUF, 0); az->codecs = NULL; } @@ -638,7 +638,7 @@ azalia_pci_detach(struct device *self, int flags) if (az->rirb_dma.addr != NULL) azalia_free_dmamem(az, &az->rirb_dma); if (az->unsolq != NULL) { - free(az->unsolq, M_DEVBUF); + free(az->unsolq, M_DEVBUF, 0); az->unsolq = NULL; } @@ -2217,7 +2217,7 @@ azalia_codec_select_dacs(codec_t *this) } } - free(convs, M_DEVBUF); + free(convs, M_DEVBUF, 0); return(err); } @@ -2612,43 +2612,43 @@ azalia_codec_delete(codec_t *this) azalia_mixer_delete(this); if (this->formats != NULL) { - free(this->formats, M_DEVBUF); + free(this->formats, M_DEVBUF, 0); this->formats = NULL; } this->nformats = 0; if (this->encs != NULL) { - free(this->encs, M_DEVBUF); + free(this->encs, M_DEVBUF, 0); this->encs = NULL; } this->nencs = 0; if (this->opins != NULL) { - free(this->opins, M_DEVBUF); + free(this->opins, M_DEVBUF, 0); this->opins = NULL; } this->nopins = 0; if (this->opins_d != NULL) { - free(this->opins_d, M_DEVBUF); + free(this->opins_d, M_DEVBUF, 0); this->opins_d = NULL; } this->nopins_d = 0; if (this->ipins != NULL) { - free(this->ipins, M_DEVBUF); + free(this->ipins, M_DEVBUF, 0); this->ipins = NULL; } this->nipins = 0; if (this->ipins_d != NULL) { - free(this->ipins_d, M_DEVBUF); + free(this->ipins_d, M_DEVBUF, 0); this->ipins_d = NULL; } this->nipins_d = 0; if (this->w != NULL) { - free(this->w, M_DEVBUF); + free(this->w, M_DEVBUF, 0); this->w = NULL; } @@ -2722,7 +2722,7 @@ azalia_codec_construct_format(codec_t *this, int newdac, int newadc) } if (this->formats != NULL) - free(this->formats, M_DEVBUF); + free(this->formats, M_DEVBUF, 0); this->nformats = 0; this->formats = malloc(sizeof(struct audio_format) * variation, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -4425,7 +4425,7 @@ azalia_create_encodings(codec_t *this) } if (this->encs != NULL) - free(this->encs, M_DEVBUF); + free(this->encs, M_DEVBUF, 0); this->nencs = 0; this->encs = malloc(sizeof(struct audio_encoding) * nencs, M_DEVBUF, M_NOWAIT | M_ZERO); diff --git a/sys/dev/pci/azalia_codec.c b/sys/dev/pci/azalia_codec.c index 97c9eabb125..f12affe009d 100644 --- a/sys/dev/pci/azalia_codec.c +++ b/sys/dev/pci/azalia_codec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia_codec.c,v 1.161 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: azalia_codec.c,v 1.162 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: azalia_codec.c,v 1.8 2006/05/10 11:17:27 kent Exp $ */ /*- @@ -1258,7 +1258,7 @@ azalia_mixer_ensure_capacity(codec_t *this, size_t newsize) return ENOMEM; } bcopy(this->mixers, newbuf, this->maxmixers * sizeof(mixer_item_t)); - free(this->mixers, M_DEVBUF); + free(this->mixers, M_DEVBUF, 0); this->mixers = newbuf; this->maxmixers = newmax; return 0; @@ -1484,7 +1484,7 @@ int azalia_mixer_delete(codec_t *this) { if (this->mixers != NULL) { - free(this->mixers, M_DEVBUF); + free(this->mixers, M_DEVBUF, 0); this->mixers = NULL; } return 0; diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c index 476a22f2399..b09e5b2dbcf 100644 --- a/sys/dev/pci/cmpci.c +++ b/sys/dev/pci/cmpci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmpci.c,v 1.36 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: cmpci.c,v 1.37 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: cmpci.c,v 1.25 2004/10/26 06:32:20 xtraeme Exp $ */ /* @@ -1362,7 +1362,7 @@ cmpci_alloc_dmamem(struct cmpci_softc *sc, size_t size, int type, int flags, bus_dmamem_free(n->cd_tag, n->cd_segs, nitems(n->cd_segs)); mfree: - free(n, type); + free(n, type, 0); quit: return error; } @@ -1380,7 +1380,7 @@ cmpci_free_dmamem(struct cmpci_softc *sc, caddr_t addr, int type) bus_dmamem_unmap(n->cd_tag, n->cd_addr, n->cd_size); bus_dmamem_free(n->cd_tag, n->cd_segs, nitems(n->cd_segs)); - free(n, type); + free(n, type, 0); return 0; } } diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 19cf8679052..671e50cc9de 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.44 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: cs4280.c,v 1.45 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -1380,7 +1380,7 @@ cs4280_malloc(void *addr, int direction, size_t size, int pool, int flags) return (0); p = malloc(sizeof(*p), pool, flags); if (!p) { - free(q,pool); + free(q,pool, 0); return (0); } /* @@ -1389,8 +1389,8 @@ cs4280_malloc(void *addr, int direction, size_t size, int pool, int flags) error = cs4280_allocmem(sc, CS4280_DCHUNK, CS4280_DALIGN, p); if (error) { - free(q, pool); - free(p, pool); + free(q, pool, 0); + free(p, pool, 0); return (0); } @@ -1411,8 +1411,8 @@ cs4280_free(void *addr, void *ptr, int pool) if (BUFADDR(p) == ptr) { cs4280_freemem(sc, p); *pp = p->next; - free(p->dum, pool); - free(p, pool); + free(p->dum, pool, 0); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 16a18804175..a78944334fe 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4281.c,v 1.30 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: cs4281.c,v 1.31 2014/07/12 18:48:51 tedu Exp $ */ /* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */ /* @@ -1338,7 +1338,7 @@ cs4281_malloc(void *addr, int direction, size_t size, int pool, int flags) error = cs4281_allocmem(sc, size, pool, flags, p); if (error) { - free(p, pool); + free(p, pool, 0); return (0); } @@ -1362,9 +1362,9 @@ cs4281_free(void *addr, void *ptr, int pool) bus_dmamap_destroy(sc->sc_dmatag, p->map); bus_dmamem_unmap(sc->sc_dmatag, p->addr, p->size); bus_dmamem_free(sc->sc_dmatag, p->segs, p->nsegs); - free(p->dum, pool); + free(p->dum, pool, 0); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index 94fca1d3174..3133bbcbb33 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drmP.h,v 1.177 2014/05/24 21:09:15 miod Exp $ */ +/* $OpenBSD: drmP.h,v 1.178 2014/07/12 18:48:52 tedu Exp $ */ /* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*- * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com */ @@ -263,7 +263,7 @@ kzalloc(size_t size, int flags) static inline void kfree(void *objp) { - free(objp, M_DRM); + free(objp, M_DRM, 0); } static inline void * @@ -275,7 +275,7 @@ vzalloc(unsigned long size) static inline void vfree(void *objp) { - free(objp, M_DRM); + free(objp, M_DRM, 0); } #define min_t(t, a, b) ({ \ diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 5a59329929f..c7266f50d44 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_drv.c,v 1.128 2014/07/02 06:09:49 matthew Exp $ */ +/* $OpenBSD: drm_drv.c,v 1.129 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org> * Copyright © 2008 Intel Corporation @@ -1155,7 +1155,7 @@ free: destroy: bus_dmamap_destroy(dmat, mem->map); strfree: - free(mem, M_DRM); + free(mem, M_DRM, 0); return (NULL); } @@ -1170,7 +1170,7 @@ drm_dmamem_free(bus_dma_tag_t dmat, struct drm_dmamem *mem) bus_dmamem_unmap(dmat, mem->kva, mem->size); bus_dmamem_free(dmat, mem->segs, mem->nsegs); bus_dmamap_destroy(dmat, mem->map); - free(mem, M_DRM); + free(mem, M_DRM, 0); } /** diff --git a/sys/dev/pci/drm/drm_edid.c b/sys/dev/pci/drm/drm_edid.c index cf490941d16..4611cbc9e34 100644 --- a/sys/dev/pci/drm/drm_edid.c +++ b/sys/dev/pci/drm/drm_edid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_edid.c,v 1.9 2014/03/09 11:07:18 jsg Exp $ */ +/* $OpenBSD: drm_edid.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Luc Verhaegen (quirks list) * Copyright (c) 2007-2008 Intel Corporation @@ -329,7 +329,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_controller *adapter) if (!new) goto out; bcopy(block, new, EDID_LENGTH); - free(block, M_DRM); + free(block, M_DRM, 0); block = new; for (j = 1; j <= block[0x7e]; j++) { @@ -360,7 +360,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_controller *adapter) if (!new) goto out; bcopy(block, new, (valid_extensions + 1) * EDID_LENGTH); - free(block, M_DRM); + free(block, M_DRM, 0); block = new; } diff --git a/sys/dev/pci/drm/drm_mem_util.h b/sys/dev/pci/drm/drm_mem_util.h index 7348f8911c4..ead94b188a2 100644 --- a/sys/dev/pci/drm/drm_mem_util.h +++ b/sys/dev/pci/drm/drm_mem_util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_mem_util.h,v 1.1 2013/08/12 04:11:52 jsg Exp $ */ +/* $OpenBSD: drm_mem_util.h,v 1.2 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright © 2008 Intel Corporation * @@ -65,10 +65,10 @@ static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) static __inline void drm_free_large(void *ptr) { - free(ptr, M_DRM); + free(ptr, M_DRM, 0); #ifdef notyet if (!is_vmalloc_addr(ptr)) - return free(ptr, M_DRM); + return free(ptr, M_DRM, 0); vfree(ptr); #endif diff --git a/sys/dev/pci/drm/drm_memory.c b/sys/dev/pci/drm/drm_memory.c index 0173c462f4b..5ad6c599cb6 100644 --- a/sys/dev/pci/drm/drm_memory.c +++ b/sys/dev/pci/drm/drm_memory.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_memory.c,v 1.25 2014/03/09 07:42:29 jsg Exp $ */ +/* $OpenBSD: drm_memory.c,v 1.26 2014/07/12 18:48:52 tedu Exp $ */ /*- *Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. @@ -68,7 +68,7 @@ drm_realloc(void *oldpt, size_t oldsize, size_t size) return NULL; if (oldpt && oldsize) { memcpy(pt, oldpt, min(oldsize, size)); - free(oldpt, M_DRM); + free(oldpt, M_DRM, 0); } return pt; } @@ -77,7 +77,7 @@ void drm_free(void *pt) { if (pt != NULL) - free(pt, M_DRM); + free(pt, M_DRM, 0); } int diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index 0e18aa242fb..6ec8b65327c 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem.c,v 1.73 2014/05/12 19:29:16 kettenis Exp $ */ +/* $OpenBSD: i915_gem.c,v 1.74 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -2036,7 +2036,7 @@ err_pages: return PTR_ERR(page); #else err_pages: - free(st, M_DRM); + free(st, M_DRM, 0); return -ENOMEM; #endif } diff --git a/sys/dev/pci/drm/i915/i915_gem_context.c b/sys/dev/pci/drm/i915/i915_gem_context.c index a23553c39ab..66f1c63a48f 100644 --- a/sys/dev/pci/drm/i915/i915_gem_context.c +++ b/sys/dev/pci/drm/i915/i915_gem_context.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem_context.c,v 1.8 2014/02/18 02:36:49 jsg Exp $ */ +/* $OpenBSD: i915_gem_context.c,v 1.9 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright © 2011-2012 Intel Corporation * @@ -326,7 +326,7 @@ void i915_gem_context_close(struct drm_device *dev, struct drm_file *file) nxt = SPLAY_NEXT(i915_ctx_tree, &file_priv->ctx_tree, han); context_idr_cleanup(han->handle, han->ctx, NULL); SPLAY_REMOVE(i915_ctx_tree, &file_priv->ctx_tree, han); - free(han, M_DRM); + free(han, M_DRM, 0); } } diff --git a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c index b71beb55710..a3ef3dc6a0f 100644 --- a/sys/dev/pci/drm/i915/i915_gem_execbuffer.c +++ b/sys/dev/pci/drm/i915/i915_gem_execbuffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem_execbuffer.c,v 1.28 2014/04/01 20:16:50 kettenis Exp $ */ +/* $OpenBSD: i915_gem_execbuffer.c,v 1.29 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -102,8 +102,8 @@ eb_get_object(struct eb_objects *eb, unsigned long handle) static void eb_destroy(struct eb_objects *eb) { - free(eb->buckets, M_DRM); - free(eb, M_DRM); + free(eb->buckets, M_DRM, 0); + free(eb, M_DRM, 0); } static inline int use_cpu_reloc(struct drm_i915_gem_object *obj) diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c index a0ed5e718fa..8f959a2a733 100644 --- a/sys/dev/pci/drm/i915/i915_irq.c +++ b/sys/dev/pci/drm/i915/i915_irq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_irq.c,v 1.12 2014/03/24 17:06:49 kettenis Exp $ */ +/* $OpenBSD: i915_irq.c,v 1.13 2014/07/12 18:48:52 tedu Exp $ */ /* i915_irq.c -- IRQ support for the I915 -*- linux-c -*- */ /* @@ -455,9 +455,9 @@ static void ivybridge_parity_work(void *arg1, void *arg2) row, bank, subbank); #if 0 - free(parity_event[3], M_DRM); - free(parity_event[2], M_DRM); - free(parity_event[1], M_DRM); + free(parity_event[3], M_DRM, 0); + free(parity_event[2], M_DRM, 0); + free(parity_event[1], M_DRM, 0); #endif } diff --git a/sys/dev/pci/drm/i915/intel_hdmi.c b/sys/dev/pci/drm/i915/intel_hdmi.c index 8e1d8cfa9ad..fd7a92a93c9 100644 --- a/sys/dev/pci/drm/i915/intel_hdmi.c +++ b/sys/dev/pci/drm/i915/intel_hdmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_hdmi.c,v 1.9 2014/01/23 10:42:57 jsg Exp $ */ +/* $OpenBSD: intel_hdmi.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2006 Dave Airlie <airlied@linux.ie> * Copyright © 2006-2009 Intel Corporation @@ -792,7 +792,7 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) drm_detect_hdmi_monitor(edid); intel_hdmi->has_audio = drm_detect_monitor_audio(edid); } - free(edid, M_DRM); + free(edid, M_DRM, 0); } if (status == connector_status_connected) { @@ -833,7 +833,7 @@ intel_hdmi_detect_audio(struct drm_connector *connector) if (edid) { if (edid->input & DRM_EDID_INPUT_DIGITAL) has_audio = drm_detect_monitor_audio(edid); - free(edid, M_DRM); + free(edid, M_DRM, 0); } return has_audio; @@ -899,7 +899,7 @@ static void intel_hdmi_destroy(struct drm_connector *connector) { drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); - free(connector, M_DRM); + free(connector, M_DRM, 0); } static const struct drm_encoder_helper_funcs intel_hdmi_helper_funcs = { diff --git a/sys/dev/pci/drm/i915/intel_modes.c b/sys/dev/pci/drm/i915/intel_modes.c index f20155bb8a1..08cea41b10a 100644 --- a/sys/dev/pci/drm/i915/intel_modes.c +++ b/sys/dev/pci/drm/i915/intel_modes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_modes.c,v 1.4 2014/01/21 04:47:38 kettenis Exp $ */ +/* $OpenBSD: intel_modes.c,v 1.5 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> * Copyright (c) 2007, 2010 Intel Corporation @@ -67,7 +67,7 @@ int intel_ddc_get_modes(struct drm_connector *connector, return 0; ret = intel_connector_update_modes(connector, edid); - free(edid, M_DRM); + free(edid, M_DRM, 0); return ret; } diff --git a/sys/dev/pci/drm/radeon/ni.c b/sys/dev/pci/drm/radeon/ni.c index b07bd1ac8da..36a644aa825 100644 --- a/sys/dev/pci/drm/radeon/ni.c +++ b/sys/dev/pci/drm/radeon/ni.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ni.c,v 1.7 2014/04/07 06:43:11 jsg Exp $ */ +/* $OpenBSD: ni.c,v 1.8 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2010 Advanced Micro Devices, Inc. * @@ -393,19 +393,19 @@ out: "ni_cp: Failed to load firmware \"%s\"\n", fw_name); if (rdev->pfp_fw) { - free(rdev->pfp_fw, M_DEVBUF); + free(rdev->pfp_fw, M_DEVBUF, 0); rdev->pfp_fw = NULL; } if (rdev->me_fw) { - free(rdev->me_fw, M_DEVBUF); + free(rdev->me_fw, M_DEVBUF, 0); rdev->me_fw = NULL; } if (rdev->rlc_fw) { - free(rdev->rlc_fw, M_DEVBUF); + free(rdev->rlc_fw, M_DEVBUF, 0); rdev->rlc_fw = NULL; } if (rdev->mc_fw) { - free(rdev->mc_fw, M_DEVBUF); + free(rdev->mc_fw, M_DEVBUF, 0); rdev->mc_fw = NULL; } } diff --git a/sys/dev/pci/drm/radeon/r100.c b/sys/dev/pci/drm/radeon/r100.c index f4eb52968f6..f26029c7ed1 100644 --- a/sys/dev/pci/drm/radeon/r100.c +++ b/sys/dev/pci/drm/radeon/r100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r100.c,v 1.7 2014/04/07 06:43:11 jsg Exp $ */ +/* $OpenBSD: r100.c,v 1.8 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -1057,7 +1057,7 @@ static int r100_cp_init_microcode(struct radeon_device *rdev) "radeon_cp: Bogus length %zu in firmware \"%s\"\n", rdev->me_fw_size, fw_name); err = -EINVAL; - free(rdev->me_fw, M_DEVBUF); + free(rdev->me_fw, M_DEVBUF, 0); rdev->me_fw = NULL; } diff --git a/sys/dev/pci/drm/radeon/r600.c b/sys/dev/pci/drm/radeon/r600.c index cdd2ad686ff..9dbdaa52e0b 100644 --- a/sys/dev/pci/drm/radeon/r600.c +++ b/sys/dev/pci/drm/radeon/r600.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r600.c,v 1.9 2014/03/09 12:32:56 jsg Exp $ */ +/* $OpenBSD: r600.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -2116,15 +2116,15 @@ out: "r600_cp: Failed to load firmware \"%s\"\n", fw_name); if (rdev->pfp_fw) { - free(rdev->pfp_fw, M_DEVBUF); + free(rdev->pfp_fw, M_DEVBUF, 0); rdev->pfp_fw = NULL; } if (rdev->me_fw) { - free(rdev->me_fw, M_DEVBUF); + free(rdev->me_fw, M_DEVBUF, 0); rdev->me_fw = NULL; } if (rdev->rlc_fw) { - free(rdev->rlc_fw, M_DEVBUF); + free(rdev->rlc_fw, M_DEVBUF, 0); rdev->rlc_fw = NULL; } } diff --git a/sys/dev/pci/drm/radeon/radeon_ttm.c b/sys/dev/pci/drm/radeon/radeon_ttm.c index 53b8ce90b88..ac86db98b0f 100644 --- a/sys/dev/pci/drm/radeon/radeon_ttm.c +++ b/sys/dev/pci/drm/radeon/radeon_ttm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radeon_ttm.c,v 1.5 2014/04/12 06:03:30 jsg Exp $ */ +/* $OpenBSD: radeon_ttm.c,v 1.6 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2009 Jerome Glisse. * All Rights Reserved. @@ -590,7 +590,7 @@ radeon_ttm_backend_destroy(struct ttm_tt *ttm) struct radeon_ttm_tt *gtt = (void *)ttm; bus_dmamap_destroy(gtt->rdev->dmat, gtt->map); - free(gtt->segs, M_DRM); + free(gtt->segs, M_DRM, 0); ttm_dma_tt_fini(>t->ttm); kfree(gtt); } @@ -631,15 +631,15 @@ struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, M_DRM, M_WAITOK | M_ZERO); if (gtt->segs == NULL) { ttm_dma_tt_fini(>t->ttm); - free(gtt, M_DRM); + free(gtt, M_DRM, 0); return NULL; } if (bus_dmamap_create(rdev->dmat, size, gtt->ttm.ttm.num_pages, size, 0, BUS_DMA_WAITOK, >t->map)) { - free(gtt->segs, M_DRM); + free(gtt->segs, M_DRM, 0); ttm_dma_tt_fini(>t->ttm); - free(gtt, M_DRM); + free(gtt, M_DRM, 0); return NULL; } diff --git a/sys/dev/pci/drm/radeon/si.c b/sys/dev/pci/drm/radeon/si.c index 9904991f384..16edebcbd82 100644 --- a/sys/dev/pci/drm/radeon/si.c +++ b/sys/dev/pci/drm/radeon/si.c @@ -1,4 +1,4 @@ -/* $OpenBSD: si.c,v 1.14 2014/06/21 04:47:58 jsg Exp $ */ +/* $OpenBSD: si.c,v 1.15 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright 2011 Advanced Micro Devices, Inc. * @@ -388,23 +388,23 @@ out: "si_cp: Failed to load firmware \"%s\"\n", fw_name); if (rdev->pfp_fw) { - free(rdev->pfp_fw, M_DEVBUF); + free(rdev->pfp_fw, M_DEVBUF, 0); rdev->pfp_fw = NULL; } if (rdev->me_fw) { - free(rdev->pfp_fw, M_DEVBUF); + free(rdev->pfp_fw, M_DEVBUF, 0); rdev->me_fw = NULL; } if (rdev->ce_fw) { - free(rdev->ce_fw, M_DEVBUF); + free(rdev->ce_fw, M_DEVBUF, 0); rdev->ce_fw = NULL; } if (rdev->rlc_fw) { - free(rdev->rlc_fw, M_DEVBUF); + free(rdev->rlc_fw, M_DEVBUF, 0); rdev->rlc_fw = NULL; } if (rdev->mc_fw) { - free(rdev->mc_fw, M_DEVBUF); + free(rdev->mc_fw, M_DEVBUF, 0); rdev->mc_fw = NULL; } } diff --git a/sys/dev/pci/eap.c b/sys/dev/pci/eap.c index f2372e2125f..b9edb88e808 100644 --- a/sys/dev/pci/eap.c +++ b/sys/dev/pci/eap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eap.c,v 1.47 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: eap.c,v 1.48 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: eap.c,v 1.46 2001/09/03 15:07:37 reinoud Exp $ */ /* @@ -1619,7 +1619,7 @@ eap_malloc(void *addr, int direction, size_t size, int pool, int flags) return (0); error = eap_allocmem(sc, size, 16, p); if (error) { - free(p, pool); + free(p, pool, 0); return (0); } p->next = sc->sc_dmas; @@ -1637,7 +1637,7 @@ eap_free(void *addr, void *ptr, int pool) if (KERNADDR(p) == ptr) { eap_freemem(sc, p); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c index 565922fa1b9..eca0c3cbfd4 100644 --- a/sys/dev/pci/emuxki.c +++ b/sys/dev/pci/emuxki.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emuxki.c,v 1.44 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: emuxki.c,v 1.45 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: emuxki.c,v 1.1 2001/10/17 18:39:41 jdolecek Exp $ */ /*- @@ -273,8 +273,8 @@ static const int emuxki_recbuf_sz[] = { void emuxki_dmamem_delete(struct dmamem *mem, int type) { - free(mem->segs, type); - free(mem, type); + free(mem->segs, type, 0); + free(mem, type, 0); } struct dmamem * @@ -295,7 +295,7 @@ emuxki_dmamem_alloc(bus_dma_tag_t dmat, size_t size, bus_size_t align, mem->segs = malloc(mem->nsegs * sizeof(*(mem->segs)), type, flags); if (mem->segs == NULL) { - free(mem, type); + free(mem, type, 0); return (NULL); } @@ -1024,7 +1024,7 @@ emuxki_mem_new(struct emuxki_softc *sc, int ptbidx, mem->ptbidx = ptbidx; if ((mem->dmamem = emuxki_dmamem_alloc(sc->sc_dmat, size, EMU_DMA_ALIGN, EMU_DMAMEM_NSEG, type, flags)) == NULL) { - free(mem, type); + free(mem, type, 0); return (NULL); } return (mem); @@ -1034,7 +1034,7 @@ void emuxki_mem_delete(struct emuxki_mem *mem, int type) { emuxki_dmamem_free(mem->dmamem, type); - free(mem, type); + free(mem, type, 0); } void * @@ -1188,7 +1188,7 @@ void emuxki_channel_delete(struct emuxki_channel *chan) { chan->voice->sc->channel[chan->num] = NULL; - free(chan, M_DEVBUF); + free(chan, M_DEVBUF, 0); } void @@ -1559,7 +1559,7 @@ emuxki_voice_delete(struct emuxki_voice *voice) if (lvoice) { emuxki_voice_dataloc_destroy(lvoice); - free(lvoice, M_DEVBUF); + free(lvoice, M_DEVBUF, 0); } } diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 045c90e6e37..0c590636bee 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.27 2013/05/24 07:58:46 ratchov Exp $ */ +/* $OpenBSD: esa.c,v 1.28 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -513,7 +513,7 @@ esa_malloc(void *hdl, int direction, size_t size, int type, int flags) return (0); error = esa_allocmem(sc, size, 16, p); if (error) { - free(p, type); + free(p, type, 0); printf("%s: esa_malloc: not enough memory\n", sc->sc_dev.dv_xname); return (0); @@ -536,7 +536,7 @@ esa_free(void *hdl, void *addr, int type) if (KERNADDR(p) == addr) { esa_freemem(sc, p); *pp = p->next; - free(p, type); + free(p, type, 0); return; } } @@ -1125,7 +1125,7 @@ esa_attach(struct device *parent, struct device *self, void *aux) if (ac97_attach(&sc->host_if) != 0) { pci_intr_disestablish(pc, sc->sc_ih); bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); - free(sc->savemem, M_DEVBUF); + free(sc->savemem, M_DEVBUF, 0); return; } @@ -1170,7 +1170,7 @@ esa_detach(struct device *self, int flags) if (sc->sc_ios) bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); - free(sc->savemem, M_DEVBUF); + free(sc->savemem, M_DEVBUF, 0); return (0); } diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index 6198f5f86c0..cf78cb92cb7 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eso.c,v 1.38 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: eso.c,v 1.39 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */ /* @@ -1641,7 +1641,7 @@ eso_allocm(void *hdl, int direction, size_t size, int type, int flags) error = eso_allocmem(sc, size, 32, boundary, flags, direction, ed); if (error) { - free(ed, type); + free(ed, type, 0); return (NULL); } ed->ed_next = sc->sc_dmas; @@ -1660,7 +1660,7 @@ eso_freem(void *hdl, void *addr, int type) if (KVADDR(p) == addr) { eso_freemem(p); *pp = p->ed_next; - free(p, type); + free(p, type, 0); return; } } diff --git a/sys/dev/pci/fms.c b/sys/dev/pci/fms.c index 1900c5f9996..25b6885f7fd 100644 --- a/sys/dev/pci/fms.c +++ b/sys/dev/pci/fms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fms.c,v 1.25 2013/11/15 16:46:27 brad Exp $ */ +/* $OpenBSD: fms.c,v 1.26 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: fms.c,v 1.5.4.1 2000/06/30 16:27:50 simonb Exp $ */ /*- @@ -737,7 +737,7 @@ fail_create: fail_map: bus_dmamem_free(sc->sc_dmat, &p->seg, 1); fail_alloc: - free(p, pool); + free(p, pool, 0); return 0; } @@ -755,7 +755,7 @@ fms_free(void *addr, void *ptr, int pool) bus_dmamem_free(sc->sc_dmat, &p->seg, 1); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 1bfe3959c5f..766c7117037 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.167 2012/01/13 09:53:24 mikeb Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.168 2014/07/12 18:48:51 tedu Exp $ */ /* * Invertex AEON / Hifn 7751 driver @@ -1853,7 +1853,7 @@ hifn_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++; @@ -2174,7 +2174,7 @@ hifn_process(struct cryptop *crp) errout: if (cmd != NULL) { explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); } if (err == EINVAL) hifnstats.hst_invalid++; @@ -2237,7 +2237,7 @@ hifn_abort(struct hifn_softc *sc) bus_dmamap_destroy(sc->sc_dmat, cmd->src_map); explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); if (crp->crp_etype != EAGAIN) crypto_done(crp); } @@ -2366,7 +2366,7 @@ out: bus_dmamap_unload(sc->sc_dmat, cmd->src_map); bus_dmamap_destroy(sc->sc_dmat, cmd->src_map); explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); crypto_done(crp); } @@ -2491,7 +2491,7 @@ fail: bus_dmamap_destroy(sc->sc_dmat, cmd->src_map); } explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); if (err == EINVAL) hifnstats.hst_invalid++; else @@ -2708,7 +2708,7 @@ hifn_callback_comp(struct hifn_softc *sc, struct hifn_command *cmd, m_freem(cmd->srcu.src_m); explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); crp->crp_etype = 0; crypto_done(crp); return; @@ -2727,7 +2727,7 @@ out: if (cmd->dstu.dst_m != NULL) m_freem(cmd->dstu.dst_m); explicit_bzero(cmd, sizeof(*cmd)); - free(cmd, M_DEVBUF); + free(cmd, M_DEVBUF, 0); crp->crp_etype = err; crypto_done(crp); } diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c index d5806775977..fad3939f12b 100644 --- a/sys/dev/pci/if_bge.c +++ b/sys/dev/pci/if_bge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bge.c,v 1.356 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_bge.c,v 1.357 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -1478,7 +1478,7 @@ bge_free_tx_ring(struct bge_softc *sc) while ((dma = SLIST_FIRST(&sc->txdma_list))) { SLIST_REMOVE_HEAD(&sc->txdma_list, link); bus_dmamap_destroy(sc->bge_dmatag, dma->dmamap); - free(dma, M_DEVBUF); + free(dma, M_DEVBUF, 0); } sc->bge_flags &= ~BGE_TXRING_VALID; diff --git a/sys/dev/pci/if_bnx.c b/sys/dev/pci/if_bnx.c index c98899230a7..0ed224d8de8 100644 --- a/sys/dev/pci/if_bnx.c +++ b/sys/dev/pci/if_bnx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bnx.c,v 1.105 2014/07/09 00:13:05 dlg Exp $ */ +/* $OpenBSD: if_bnx.c,v 1.106 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2006 Broadcom Corporation @@ -444,7 +444,7 @@ bnx_read_firmware(struct bnx_softc *sc, int idx) return (error); if (size < sizeof(struct bnx_firmware_header)) { - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (EINVAL); } @@ -577,7 +577,7 @@ bnx_read_firmware(struct bnx_softc *sc, int idx) nswaph(bfw->bnx_TXP_FwSbss, hdr->bnx_TXP_FwSbssLen); if (q - p != size) { - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); hdr = NULL; return EINVAL; } @@ -603,7 +603,7 @@ bnx_read_rv2p(struct bnx_softc *sc, int idx) return (error); if (size < sizeof(struct bnx_rv2p_header)) { - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (EINVAL); } @@ -622,7 +622,7 @@ bnx_read_rv2p(struct bnx_softc *sc, int idx) nswaph(rv2p->bnx_rv2p_proc2, hdr->bnx_rv2p_proc2len); if (q - p != size) { - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return EINVAL; } @@ -2090,7 +2090,7 @@ bnx_nvram_write(struct bnx_softc *sc, u_int32_t offset, u_int8_t *data_buf, nvram_write_end: if (align_start || align_end) - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (rc); } diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 4c934eb26e8..344087749bb 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.285 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_em.c,v 1.286 2014/07/12 18:48:51 tedu Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2297,7 +2297,7 @@ em_free_transmit_structures(struct em_softc *sc) } } if (sc->tx_buffer_area != NULL) { - free(sc->tx_buffer_area, M_DEVBUF); + free(sc->tx_buffer_area, M_DEVBUF, 0); sc->tx_buffer_area = NULL; } if (sc->txtag != NULL) @@ -2747,7 +2747,7 @@ em_free_receive_structures(struct em_softc *sc) } } if (sc->rx_buffer_area != NULL) { - free(sc->rx_buffer_area, M_DEVBUF); + free(sc->rx_buffer_area, M_DEVBUF, 0); sc->rx_buffer_area = NULL; } if (sc->rxtag != NULL) diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 62bc5188bb5..35d22a08832 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.99 2014/03/27 11:32:29 daniel Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.100 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1690,7 +1690,7 @@ ipw_read_firmware(struct ipw_softc *sc, struct ipw_firmware *fw) return 0; -fail: free(fw->data, M_DEVBUF); +fail: free(fw->data, M_DEVBUF, 0); return error; } @@ -2031,7 +2031,7 @@ ipw_init(struct ifnet *ifp) goto fail2; } sc->sc_flags |= IPW_FLAG_FW_INITED; - free(fw.data, M_DEVBUF); + free(fw.data, M_DEVBUF, 0); fw.data = NULL; /* retrieve information tables base addresses */ @@ -2056,7 +2056,7 @@ ipw_init(struct ifnet *ifp) return 0; -fail2: free(fw.data, M_DEVBUF); +fail2: free(fw.data, M_DEVBUF, 0); fw.data = NULL; fail1: ipw_stop(ifp, 0); return error; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index dcd2b963996..9766ba969e2 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.116 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.117 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2004-2008 @@ -2311,7 +2311,7 @@ iwi_init(struct ifnet *ifp) goto fail2; } - free(data, M_DEVBUF); + free(data, M_DEVBUF, 0); sc->sc_flags |= IWI_FLAG_FW_INITED; if ((error = iwi_config(sc)) != 0) { @@ -2330,7 +2330,7 @@ iwi_init(struct ifnet *ifp) return 0; -fail2: free(data, M_DEVBUF); +fail2: free(data, M_DEVBUF, 0); fail1: iwi_stop(ifp, 0); return error; } diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 10f09259788..8e9b1a86087 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.131 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.132 2014/07/12 18:48:51 tedu Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -2160,7 +2160,7 @@ iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, /* Save calibration result. */ if (sc->calibcmd[idx].buf != NULL) - free(sc->calibcmd[idx].buf, M_DEVBUF); + free(sc->calibcmd[idx].buf, M_DEVBUF, 0); sc->calibcmd[idx].buf = malloc(len, M_DEVBUF, M_NOWAIT); if (sc->calibcmd[idx].buf == NULL) { DPRINTF(("not enough memory for calibration result %d\n", @@ -4556,7 +4556,7 @@ iwn_scan(struct iwn_softc *sc, uint16_t flags) DPRINTF(("sending scan command nchan=%d\n", hdr->nchan)); error = iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return error; } @@ -5619,7 +5619,7 @@ iwn_read_firmware(struct iwn_softc *sc) if (fw->size < sizeof (uint32_t)) { printf("%s: firmware too short: %zu bytes\n", sc->sc_dev.dv_xname, fw->size); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return EINVAL; } @@ -5631,7 +5631,7 @@ iwn_read_firmware(struct iwn_softc *sc) if (error != 0) { printf("%s: could not read firmware sections\n", sc->sc_dev.dv_xname); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return error; } @@ -5644,7 +5644,7 @@ iwn_read_firmware(struct iwn_softc *sc) (fw->boot.textsz & 3) != 0) { printf("%s: firmware sections too large\n", sc->sc_dev.dv_xname); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return EINVAL; } @@ -6047,7 +6047,7 @@ iwn_init(struct ifnet *ifp) /* Initialize hardware and upload firmware. */ error = iwn_hw_init(sc); - free(sc->fw.data, M_DEVBUF); + free(sc->fw.data, M_DEVBUF, 0); if (error != 0) { printf("%s: could not initialize hardware\n", sc->sc_dev.dv_xname); diff --git a/sys/dev/pci/if_ix.c b/sys/dev/pci/if_ix.c index 1d0618b8338..500c15578cb 100644 --- a/sys/dev/pci/if_ix.c +++ b/sys/dev/pci/if_ix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ix.c,v 1.94 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_ix.c,v 1.95 2014/07/12 18:48:51 tedu Exp $ */ /****************************************************************************** @@ -302,7 +302,7 @@ err_late: ixgbe_free_receive_structures(sc); err_out: ixgbe_free_pci_resources(sc); - free(sc->mta, M_DEVBUF); + free(sc->mta, M_DEVBUF, 0); } /********************************************************************* @@ -340,7 +340,7 @@ ixgbe_detach(struct device *self, int flags) ixgbe_free_transmit_structures(sc); ixgbe_free_receive_structures(sc); - free(sc->mta, M_DEVBUF); + free(sc->mta, M_DEVBUF, 0); return (0); } @@ -1790,10 +1790,10 @@ err_rx_desc: err_tx_desc: for (txr = sc->tx_rings; txconf > 0; txr++, txconf--) ixgbe_dma_free(sc, &txr->txdma); - free(sc->rx_rings, M_DEVBUF); + free(sc->rx_rings, M_DEVBUF, 0); sc->rx_rings = NULL; rx_fail: - free(sc->tx_rings, M_DEVBUF); + free(sc->tx_rings, M_DEVBUF, 0); sc->tx_rings = NULL; fail: return (ENOMEM); @@ -2028,7 +2028,7 @@ ixgbe_free_transmit_buffers(struct tx_ring *txr) } if (txr->tx_buffers != NULL) - free(txr->tx_buffers, M_DEVBUF); + free(txr->tx_buffers, M_DEVBUF, 0); txr->tx_buffers = NULL; txr->txtag = NULL; } @@ -2773,7 +2773,7 @@ ixgbe_free_receive_buffers(struct rx_ring *rxr) bus_dmamap_destroy(rxr->rxdma.dma_tag, rxbuf->map); rxbuf->map = NULL; } - free(rxr->rx_buffers, M_DEVBUF); + free(rxr->rx_buffers, M_DEVBUF, 0); rxr->rx_buffers = NULL; } } diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 9886d39bd40..01177056862 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.60 2013/11/26 09:50:33 mpi Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.61 2014/07/12 18:48:51 tedu Exp $ */ #include <dev/pci/if_ixgb.h> @@ -1273,7 +1273,7 @@ ixgb_free_transmit_structures(struct ixgb_softc *sc) } } if (sc->tx_buffer_area != NULL) { - free(sc->tx_buffer_area, M_DEVBUF); + free(sc->tx_buffer_area, M_DEVBUF, 0); sc->tx_buffer_area = NULL; } if (sc->txtag != NULL) { @@ -1686,7 +1686,7 @@ ixgb_free_receive_structures(struct ixgb_softc *sc) } } if (sc->rx_buffer_area != NULL) { - free(sc->rx_buffer_area, M_DEVBUF); + free(sc->rx_buffer_area, M_DEVBUF, 0); sc->rx_buffer_area = NULL; } if (sc->rxtag != NULL) diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 9c1e74eb0b9..c4e460af451 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_msk.c,v 1.104 2014/07/09 00:15:20 dlg Exp $ */ +/* $OpenBSD: if_msk.c,v 1.105 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -2140,7 +2140,7 @@ msk_stop(struct sk_if_softc *sc_if, int softonly) while ((dma = SIMPLEQ_FIRST(&sc_if->sk_txmap_head))) { SIMPLEQ_REMOVE_HEAD(&sc_if->sk_txmap_head, link); bus_dmamap_destroy(sc->sc_dmatag, dma->dmamap); - free(dma, M_DEVBUF); + free(dma, M_DEVBUF, 0); } } diff --git a/sys/dev/pci/if_myx.c b/sys/dev/pci/if_myx.c index 30e46b52350..a2ecd730bc1 100644 --- a/sys/dev/pci/if_myx.c +++ b/sys/dev/pci/if_myx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_myx.c,v 1.60 2014/07/10 07:02:50 dlg Exp $ */ +/* $OpenBSD: if_myx.c,v 1.61 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org> @@ -462,7 +462,7 @@ myx_loadfirmware(struct myx_softc *sc, const char *filename) ret = 0; err: - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return (ret); } diff --git a/sys/dev/pci/if_nxe.c b/sys/dev/pci/if_nxe.c index c33346a98fe..6258787258f 100644 --- a/sys/dev/pci/if_nxe.c +++ b/sys/dev/pci/if_nxe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nxe.c,v 1.64 2013/11/21 19:08:14 gsoares Exp $ */ +/* $OpenBSD: if_nxe.c,v 1.65 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1651,7 +1651,7 @@ nxe_board_info(struct nxe_softc *sc) rv = 0; out: - free(ni, M_TEMP); + free(ni, M_TEMP, 0); return (rv); } @@ -1693,7 +1693,7 @@ nxe_user_info(struct nxe_softc *sc) rv = 0; out: - free(nu, M_TEMP); + free(nu, M_TEMP, 0); return (rv); } @@ -1852,7 +1852,7 @@ nxe_ring_alloc(struct nxe_softc *sc, size_t desclen, u_int nentries) nr->nr_dmamem = nxe_dmamem_alloc(sc, desclen * nentries, PAGE_SIZE); if (nr->nr_dmamem == NULL) { - free(nr, M_DEVBUF); + free(nr, M_DEVBUF, 0); return (NULL); } @@ -1875,7 +1875,7 @@ void nxe_ring_free(struct nxe_softc *sc, struct nxe_ring *nr) { nxe_dmamem_free(sc, nr->nr_dmamem); - free(nr, M_DEVBUF); + free(nr, M_DEVBUF, 0); } int @@ -1956,8 +1956,8 @@ nxe_pkt_free(struct nxe_softc *sc, struct nxe_pkt_list *npl) while ((pkt = nxe_pkt_get(npl)) != NULL) bus_dmamap_destroy(sc->sc_dmat, pkt->pkt_dmap); - free(npl->npl_pkts, M_DEVBUF); - free(npl, M_DEVBUF); + free(npl->npl_pkts, M_DEVBUF, 0); + free(npl, M_DEVBUF, 0); } struct nxe_pkt * @@ -2022,7 +2022,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); ndmfree: - free(ndm, M_DEVBUF); + free(ndm, M_DEVBUF, 0); return (NULL); } @@ -2033,7 +2033,7 @@ nxe_dmamem_free(struct nxe_softc *sc, struct nxe_dmamem *ndm) bus_dmamem_unmap(sc->sc_dmat, ndm->ndm_kva, ndm->ndm_size); bus_dmamem_free(sc->sc_dmat, &ndm->ndm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); - free(ndm, M_DEVBUF); + free(ndm, M_DEVBUF, 0); } u_int32_t diff --git a/sys/dev/pci/if_oce.c b/sys/dev/pci/if_oce.c index 4e08eb2b947..a34e5a35cb7 100644 --- a/sys/dev/pci/if_oce.c +++ b/sys/dev/pci/if_oce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_oce.c,v 1.75 2014/07/08 05:35:18 dlg Exp $ */ +/* $OpenBSD: if_oce.c,v 1.76 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 Mike Belopuhov @@ -1987,7 +1987,7 @@ oce_create_wq(struct oce_softc *sc, struct oce_eq *eq) wq->ring = oce_create_ring(sc, sc->sc_tx_ring_size, NIC_WQE_SIZE, 8); if (!wq->ring) { - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); return (NULL); } @@ -1995,7 +1995,7 @@ oce_create_wq(struct oce_softc *sc, struct oce_eq *eq) 1, 0, 3); if (!cq) { oce_destroy_ring(sc, wq->ring); - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); return (NULL); } @@ -2066,7 +2066,7 @@ oce_destroy_wq(struct oce_wq *wq) oce_destroy_ring(sc, wq->ring); while ((pkt = oce_pkt_get(&wq->pkt_free)) != NULL) oce_pkt_free(sc, pkt); - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); } /** @@ -2095,7 +2095,7 @@ oce_create_rq(struct oce_softc *sc, struct oce_eq *eq, int rss) rq->ring = oce_create_ring(sc, sc->sc_rx_ring_size, sizeof(struct oce_nic_rqe), 2); if (!rq->ring) { - free(rq, M_DEVBUF); + free(rq, M_DEVBUF, 0); return (NULL); } @@ -2103,7 +2103,7 @@ oce_create_rq(struct oce_softc *sc, struct oce_eq *eq, int rss) 1, 0, 3); if (!cq) { oce_destroy_ring(sc, rq->ring); - free(rq, M_DEVBUF); + free(rq, M_DEVBUF, 0); return (NULL); } @@ -2172,7 +2172,7 @@ oce_destroy_rq(struct oce_rq *rq) oce_destroy_ring(sc, rq->ring); while ((pkt = oce_pkt_get(&rq->pkt_free)) != NULL) oce_pkt_free(sc, pkt); - free(rq, M_DEVBUF); + free(rq, M_DEVBUF, 0); } struct oce_eq * @@ -2187,7 +2187,7 @@ oce_create_eq(struct oce_softc *sc) eq->ring = oce_create_ring(sc, EQ_LEN_1024, EQE_SIZE_4, 8); if (!eq->ring) { - free(eq, M_DEVBUF); + free(eq, M_DEVBUF, 0); return (NULL); } @@ -2199,7 +2199,7 @@ oce_create_eq(struct oce_softc *sc) if (oce_new_eq(sc, eq)) { oce_destroy_ring(sc, eq->ring); - free(eq, M_DEVBUF); + free(eq, M_DEVBUF, 0); return (NULL); } @@ -2250,7 +2250,7 @@ oce_destroy_eq(struct oce_eq *eq) } if (eq->ring != NULL) oce_destroy_ring(sc, eq->ring); - free(eq, M_DEVBUF); + free(eq, M_DEVBUF, 0); } struct oce_mq * @@ -2266,7 +2266,7 @@ oce_create_mq(struct oce_softc *sc, struct oce_eq *eq) mq->ring = oce_create_ring(sc, 128, sizeof(struct oce_mbx), 8); if (!mq->ring) { - free(mq, M_DEVBUF); + free(mq, M_DEVBUF, 0); return (NULL); } @@ -2274,7 +2274,7 @@ oce_create_mq(struct oce_softc *sc, struct oce_eq *eq) 1, 0, 0); if (!cq) { oce_destroy_ring(sc, mq->ring); - free(mq, M_DEVBUF); + free(mq, M_DEVBUF, 0); return (NULL); } @@ -2287,7 +2287,7 @@ oce_create_mq(struct oce_softc *sc, struct oce_eq *eq) if (oce_new_mq(sc, mq)) { oce_destroy_cq(mq->cq); oce_destroy_ring(sc, mq->ring); - free(mq, M_DEVBUF); + free(mq, M_DEVBUF, 0); return (NULL); } @@ -2332,7 +2332,7 @@ oce_destroy_mq(struct oce_mq *mq) oce_destroy_ring(sc, mq->ring); if (mq->cq != NULL) oce_destroy_cq(mq->cq); - free(mq, M_DEVBUF); + free(mq, M_DEVBUF, 0); } /** @@ -2358,7 +2358,7 @@ oce_create_cq(struct oce_softc *sc, struct oce_eq *eq, int nitems, int isize, cq->ring = oce_create_ring(sc, nitems, isize, 4); if (!cq->ring) { - free(cq, M_DEVBUF); + free(cq, M_DEVBUF, 0); return (NULL); } @@ -2371,7 +2371,7 @@ oce_create_cq(struct oce_softc *sc, struct oce_eq *eq, int nitems, int isize, if (oce_new_cq(sc, cq)) { oce_destroy_ring(sc, cq->ring); - free(cq, M_DEVBUF); + free(cq, M_DEVBUF, 0); return (NULL); } @@ -2394,7 +2394,7 @@ oce_destroy_cq(struct oce_cq *cq) } if (cq->ring != NULL) oce_destroy_ring(sc, cq->ring); - free(cq, M_DEVBUF); + free(cq, M_DEVBUF, 0); } /** @@ -2561,7 +2561,7 @@ fail_2: fail_1: bus_dmamap_destroy(dma->tag, dma->map); fail_0: - free(ring, M_DEVBUF); + free(ring, M_DEVBUF, 0); return (NULL); } @@ -2569,7 +2569,7 @@ void oce_destroy_ring(struct oce_softc *sc, struct oce_ring *ring) { oce_dma_free(sc, &ring->dma); - free(ring, M_DEVBUF); + free(ring, M_DEVBUF, 0); } int diff --git a/sys/dev/pci/if_san_common.c b/sys/dev/pci/if_san_common.c index 97520328402..a4c4e2e4409 100644 --- a/sys/dev/pci/if_san_common.c +++ b/sys/dev/pci/if_san_common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_common.c,v 1.16 2013/08/07 01:06:37 bluhm Exp $ */ +/* $OpenBSD: if_san_common.c,v 1.17 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -123,7 +123,7 @@ static san_detach(void) tmp_card = card; card = LIST_NEXT(card, next); LIST_REMOVE(tmp_card, next); - free(tmp_card, M_DEVBUF); + free(tmp_card, M_DEVBUF, 0); } log(LOG_INFO, "\n"); @@ -354,7 +354,7 @@ wan_ioctl_dump(sdla_t *card, void *u_dump) log(LOG_INFO, "%s: Failed to copy to user space (%d)\n", card->devname, __LINE__); } - free(data, M_DEVBUF); + free(data, M_DEVBUF, 0); return err; } diff --git a/sys/dev/pci/if_san_xilinx.c b/sys/dev/pci/if_san_xilinx.c index baa7d429d43..7cba72e04ea 100644 --- a/sys/dev/pci/if_san_xilinx.c +++ b/sys/dev/pci/if_san_xilinx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_san_xilinx.c,v 1.28 2013/08/07 01:06:37 bluhm Exp $ */ +/* $OpenBSD: if_san_xilinx.c,v 1.29 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -352,7 +352,7 @@ wan_xilinx_init(sdla_t *card) ifp->if_softc = sc; sc->common.card = card; if (wanpipe_generic_register(card, ifp, card->devname)) { - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (NULL); } @@ -427,7 +427,7 @@ wan_xilinx_release(sdla_t* card, struct ifnet* ifp) wanpipe_generic_unregister(ifp); ifp->if_softc = NULL; - free(sc, M_DEVBUF); + free(sc, M_DEVBUF, 0); return (0); } @@ -2418,7 +2418,7 @@ aft_release_rx_buffers(xilinx_softc_t *sc) aft_release_rx_dma_buff(sc, buf); } - free(sc->wp_rx_buffers, M_DEVBUF); + free(sc->wp_rx_buffers, M_DEVBUF, 0); sc->wp_rx_buffers = NULL; sc->wp_rx_buffer_last = NULL; diff --git a/sys/dev/pci/if_sandrv.c b/sys/dev/pci/if_sandrv.c index 57c8df4dc98..520b54ee5bc 100644 --- a/sys/dev/pci/if_sandrv.c +++ b/sys/dev/pci/if_sandrv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sandrv.c,v 1.15 2013/11/11 03:08:20 dlg Exp $ */ +/* $OpenBSD: if_sandrv.c,v 1.16 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2001-2004 Sangoma Technologies (SAN) @@ -385,7 +385,7 @@ sdladrv_exit(void) return EBUSY; } LIST_REMOVE(tmp, next); - free(tmp, M_DEVBUF); + free(tmp, M_DEVBUF, 0); } #endif return (0); @@ -632,7 +632,7 @@ sdla_card_unregister(u_int16_t atype, int slot_no, int bus_no, int ioport) return (EBUSY); } LIST_REMOVE(tmp_card, next); - free(tmp_card, M_DEVBUF); + free(tmp_card, M_DEVBUF, 0); return 0; } #endif @@ -723,7 +723,7 @@ sdla_hw_unregister(sdlahw_card_t* hwcard, int cpu_no) tmp_hw->hwcard = NULL; hwcard->used--; /* Decrement card usage */ LIST_REMOVE(tmp_hw, next); - free(tmp_hw, M_DEVBUF); + free(tmp_hw, M_DEVBUF, 0); return (0); } diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 9606e386bd8..d4a50c63b67 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.168 2014/04/19 18:29:39 henning Exp $ */ +/* $OpenBSD: if_sk.c,v 1.169 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -2682,7 +2682,7 @@ sk_stop(struct sk_if_softc *sc_if, int softonly) while ((dma = SIMPLEQ_FIRST(&sc_if->sk_txmap_head))) { SIMPLEQ_REMOVE_HEAD(&sc_if->sk_txmap_head, link); bus_dmamap_destroy(sc->sc_dmatag, dma->dmamap); - free(dma, M_DEVBUF); + free(dma, M_DEVBUF, 0); } } diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index dad29074220..e8928f84196 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.126 2013/04/02 13:43:40 brad Exp $ */ +/* $OpenBSD: if_tht.c,v 1.127 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1728,7 +1728,7 @@ tht_fw_load(struct tht_softc *sc) tht_write(sc, THT_REG_INIT_SEMAPHORE, 0x1); err: - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return (error); } @@ -1854,7 +1854,7 @@ free: destroy: bus_dmamap_destroy(dmat, tdm->tdm_map); tdmfree: - free(tdm, M_DEVBUF); + free(tdm, M_DEVBUF, 0); return (NULL); } @@ -1868,7 +1868,7 @@ tht_dmamem_free(struct tht_softc *sc, struct tht_dmamem *tdm) bus_dmamem_unmap(dmat, tdm->tdm_kva, tdm->tdm_size); bus_dmamem_free(dmat, &tdm->tdm_seg, 1); bus_dmamap_destroy(dmat, tdm->tdm_map); - free(tdm, M_DEVBUF); + free(tdm, M_DEVBUF, 0); } int @@ -1909,7 +1909,7 @@ tht_pkt_free(struct tht_softc *sc, struct tht_pkt_list *tpl) while ((pkt = tht_pkt_get(tpl)) != NULL) bus_dmamap_destroy(dmat, pkt->tp_dmap); - free(tpl->tpl_pkts, M_DEVBUF); + free(tpl->tpl_pkts, M_DEVBUF, 0); tpl->tpl_pkts = NULL; } diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index c9126fa65e9..726fe0dcc12 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.108 2013/11/26 09:50:33 mpi Exp $ */ +/* $OpenBSD: if_txp.c,v 1.109 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2001 @@ -436,10 +436,10 @@ txp_download_fw(struct txp_softc *sc) WRITE_REG(sc, TXP_IER, ier); WRITE_REG(sc, TXP_IMR, imr); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (0); fail: - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (-1); } @@ -639,7 +639,7 @@ txp_rx_reclaim(struct txp_softc *sc, struct txp_rx_ring *r, bus_dmamap_unload(sc->sc_dmat, sd->sd_map); bus_dmamap_destroy(sc->sc_dmat, sd->sd_map); m = sd->sd_mbuf; - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); m->m_pkthdr.len = m->m_len = letoh16(rxd->rx_len); #ifdef __STRICT_ALIGNMENT @@ -806,7 +806,7 @@ txp_rxbuf_reclaim(struct txp_softc *sc) err_mbuf: m_freem(sd->sd_mbuf); err_sd: - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); } /* @@ -1105,7 +1105,7 @@ bail_rxbufring: for (i = 0; i < RXBUF_ENTRIES; i++) { bcopy((u_long *)&sc->sc_rxbufs[i].rb_vaddrlo, &sd, sizeof(sd)); if (sd) - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); } txp_dma_free(sc, &sc->sc_rxbufring_dma); bail_rspring: @@ -1289,7 +1289,7 @@ txp_tick(void *vsc) out: if (rsp != NULL) - free(rsp, M_DEVBUF); + free(rsp, M_DEVBUF, 0); splx(s); timeout_add_sec(&sc->sc_tick, 1); @@ -1495,7 +1495,7 @@ txp_command(struct txp_softc *sc, u_int16_t id, u_int16_t in1, *out2 = letoh32(rsp->rsp_par2); if (out3 != NULL) *out3 = letoh32(rsp->rsp_par3); - free(rsp, M_DEVBUF); + free(rsp, M_DEVBUF, 0); return (0); } @@ -1956,5 +1956,5 @@ txp_capabilities(struct txp_softc *sc) out: if (rsp != NULL) - free(rsp, M_DEVBUF); + free(rsp, M_DEVBUF, 0); } diff --git a/sys/dev/pci/if_vic.c b/sys/dev/pci/if_vic.c index 5e7fa4d1ad5..747be9a9efe 100644 --- a/sys/dev/pci/if_vic.c +++ b/sys/dev/pci/if_vic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vic.c,v 1.79 2014/07/10 11:15:52 dlg Exp $ */ +/* $OpenBSD: if_vic.c,v 1.80 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org> @@ -627,11 +627,11 @@ vic_alloc_data(struct vic_softc *sc) return (0); freetx: - free(sc->sc_txbuf, M_DEVBUF); + free(sc->sc_txbuf, M_DEVBUF, 0); q = VIC_NRXRINGS; freerx: while (q--) - free(sc->sc_rxq[q].bufs, M_DEVBUF); + free(sc->sc_rxq[q].bufs, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/pci/if_vio.c b/sys/dev/pci/if_vio.c index fb22fd2dd6f..91b505904b3 100644 --- a/sys/dev/pci/if_vio.c +++ b/sys/dev/pci/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.17 2014/07/08 05:35:19 dlg Exp $ */ +/* $OpenBSD: if_vio.c,v 1.18 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -473,7 +473,7 @@ err_reqs: bus_dmamap_destroy(vsc->sc_dmat, sc->sc_rx_dmamaps[i]); } if (sc->sc_arrays) { - free(sc->sc_arrays, M_DEVBUF); + free(sc->sc_arrays, M_DEVBUF, 0); sc->sc_arrays = 0; } err_hdr: diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index e0da804d2a9..f2195884529 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.118 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.119 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2006-2008 @@ -2643,7 +2643,7 @@ wpi_scan(struct wpi_softc *sc, uint16_t flags) DPRINTF(("sending scan command nchan=%d\n", hdr->nchan)); error = wpi_cmd(sc, WPI_CMD_SCAN, buf, buflen, 1); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return error; } @@ -3000,7 +3000,7 @@ wpi_read_firmware(struct wpi_softc *sc) if (size < sizeof (*hdr)) { printf("%s: truncated firmware header: %zu bytes\n", sc->sc_dev.dv_xname, size); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return EINVAL; } /* Extract firmware header information. */ @@ -3020,7 +3020,7 @@ wpi_read_firmware(struct wpi_softc *sc) fw->boot.textsz > WPI_FW_BOOT_TEXT_MAXSZ || (fw->boot.textsz & 3) != 0) { printf("%s: invalid firmware header\n", sc->sc_dev.dv_xname); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return EINVAL; } @@ -3029,7 +3029,7 @@ wpi_read_firmware(struct wpi_softc *sc) fw->init.textsz + fw->init.datasz + fw->boot.textsz) { printf("%s: firmware file too short: %zu bytes\n", sc->sc_dev.dv_xname, size); - free(fw->data, M_DEVBUF); + free(fw->data, M_DEVBUF, 0); return EINVAL; } @@ -3321,7 +3321,7 @@ wpi_init(struct ifnet *ifp) /* Initialize hardware and upload firmware. */ error = wpi_hw_init(sc); - free(sc->fw.data, M_DEVBUF); + free(sc->fw.data, M_DEVBUF, 0); if (error != 0) { printf("%s: could not initialize hardware\n", sc->sc_dev.dv_xname); diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 11582a6bc9e..9a2b5fc75cc 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.108 2011/07/17 22:46:48 matthew Exp $ */ +/* $OpenBSD: ips.c,v 1.109 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -815,7 +815,7 @@ ips_attach(struct device *parent, struct device *self, void *aux) } if (sensor_task_register(sc, ips_sensors, 10) == NULL) { printf(": no sensors support\n"); - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return; } sensordev_install(&sc->sc_sensordev); @@ -2002,7 +2002,7 @@ ips_ccb_alloc(struct ips_softc *sc, int n) fail: for (; i > 0; i--) bus_dmamap_destroy(sc->sc_dmat, ccb[i - 1].c_dmam); - free(ccb, M_DEVBUF); + free(ccb, M_DEVBUF, 0); return (NULL); } @@ -2013,7 +2013,7 @@ ips_ccb_free(struct ips_softc *sc, struct ips_ccb *ccb, int n) for (i = 0; i < n; i++) bus_dmamap_destroy(sc->sc_dmat, ccb[i - 1].c_dmam); - free(ccb, M_DEVBUF); + free(ccb, M_DEVBUF, 0); } void * diff --git a/sys/dev/pci/isp_pci.c b/sys/dev/pci/isp_pci.c index 73bddd64e1a..16e057ba912 100644 --- a/sys/dev/pci/isp_pci.c +++ b/sys/dev/pci/isp_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_pci.c,v 1.59 2014/02/14 05:17:05 jmatthew Exp $ */ +/* $OpenBSD: isp_pci.c,v 1.60 2014/07/12 18:48:52 tedu Exp $ */ /* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.148 2007/06/26 23:08:57 mjacob Exp $*/ /*- * Copyright (c) 1997-2006 by Matthew Jacob @@ -752,7 +752,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux) if (pci_intr_map(pa, &ih)) { printf(": couldn't map interrupt\n"); - free(isp->isp_param, M_DEVBUF); + free(isp->isp_param, M_DEVBUF, 0); return; } intrstr = pci_intr_string(pa->pa_pc, ih); @@ -763,7 +763,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux) if (pcs->pci_ih == NULL) { printf(": couldn't establish interrupt at %s\n", intrstr); - free(isp->isp_param, M_DEVBUF); + free(isp->isp_param, M_DEVBUF, 0); return; } @@ -783,7 +783,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux) isp_reset(isp); if (isp->isp_state != ISP_RESETSTATE) { ISP_UNLOCK(isp); - free(isp->isp_param, M_DEVBUF); + free(isp->isp_param, M_DEVBUF, 0); return; } ISP_ENABLE_INTS(isp); @@ -791,7 +791,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux) if (isp->isp_state != ISP_INITSTATE) { isp_uninit(isp); ISP_UNLOCK(isp); - free(isp->isp_param, M_DEVBUF); + free(isp->isp_param, M_DEVBUF, 0); return; } /* @@ -801,7 +801,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux) if (isp->isp_state != ISP_RUNSTATE) { isp_uninit(isp); ISP_UNLOCK(isp); - free(isp->isp_param, M_DEVBUF); + free(isp->isp_param, M_DEVBUF, 0); } else { ISP_UNLOCK(isp); } @@ -1084,7 +1084,7 @@ isp_pci_mbxdma(struct ispsoftc *isp) len = isp->isp_maxcmds * sizeof (bus_dmamap_t); pcs->pci_xfer_dmap = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_NOWAIT); if (pcs->pci_xfer_dmap == NULL) { - free(isp->isp_xflist, M_DEVBUF); + free(isp->isp_xflist, M_DEVBUF, 0); isp->isp_xflist = NULL; isp_prt(isp, ISP_LOGERR, "cannot malloc dma map array"); return (1); @@ -1102,8 +1102,8 @@ isp_pci_mbxdma(struct ispsoftc *isp) while (--i >= 0) { bus_dmamap_destroy(dmat, pcs->pci_xfer_dmap[i]); } - free(isp->isp_xflist, M_DEVBUF); - free(pcs->pci_xfer_dmap, M_DEVBUF); + free(isp->isp_xflist, M_DEVBUF, 0); + free(pcs->pci_xfer_dmap, M_DEVBUF, 0); isp->isp_xflist = NULL; pcs->pci_xfer_dmap = NULL; return (1); @@ -1165,8 +1165,8 @@ dmafail: for (i = 0; i < isp->isp_maxcmds; i++) { bus_dmamap_destroy(dmat, pcs->pci_xfer_dmap[i]); } - free(isp->isp_xflist, M_DEVBUF); - free(pcs->pci_xfer_dmap, M_DEVBUF); + free(isp->isp_xflist, M_DEVBUF, 0); + free(pcs->pci_xfer_dmap, M_DEVBUF, 0); isp->isp_xflist = NULL; pcs->pci_xfer_dmap = NULL; return (1); diff --git a/sys/dev/pci/lofn.c b/sys/dev/pci/lofn.c index 212c79316dd..1a4de67f640 100644 --- a/sys/dev/pci/lofn.c +++ b/sys/dev/pci/lofn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lofn.c,v 1.29 2011/01/12 17:01:26 deraadt Exp $ */ +/* $OpenBSD: lofn.c,v 1.30 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2001-2002 Jason L. Wright (jason@thought.net) @@ -200,7 +200,7 @@ lofn_intr(vsc) q = sc->sc_current; sc->sc_current = NULL; q->q_finish(sc, q); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); lofn_feed(sc); } } @@ -317,7 +317,7 @@ lofn_kprocess(krp) sc->sc_dv.dv_xname, krp->krp_op); krp->krp_status = EOPNOTSUPP; crypto_kdone(krp); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); return (0); } } @@ -540,7 +540,7 @@ lofn_feed(sc) break; } else { SIMPLEQ_REMOVE_HEAD(&sc->sc_queue, q_next); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); } } } diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 7b964bdde04..c949f493dc6 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.36 2013/11/15 16:46:27 brad Exp $ */ +/* $OpenBSD: maestro.c,v 1.37 2014/07/12 18:48:52 tedu Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -1776,7 +1776,7 @@ salloc_new(caddr_t addr, size_t size, int nzones) void salloc_destroy(salloc_t pool) { - free(pool, M_TEMP); + free(pool, M_TEMP, 0); } void diff --git a/sys/dev/pci/mfii.c b/sys/dev/pci/mfii.c index 9fc64e2c884..72e736afaed 100644 --- a/sys/dev/pci/mfii.c +++ b/sys/dev/pci/mfii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfii.c,v 1.15 2014/03/28 22:25:49 dlg Exp $ */ +/* $OpenBSD: mfii.c,v 1.16 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> @@ -476,7 +476,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, m->mdm_map); mdmfree: - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return (NULL); } @@ -488,7 +488,7 @@ mfii_dmamem_free(struct mfii_softc *sc, struct mfii_dmamem *m) bus_dmamem_unmap(sc->sc_dmat, m->mdm_kva, m->mdm_size); bus_dmamem_free(sc->sc_dmat, &m->mdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, m->mdm_map); - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); } @@ -1430,7 +1430,7 @@ destroy: while ((ccb = mfii_get_ccb(sc)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); - free(sc->sc_ccb, M_DEVBUF); + free(sc->sc_ccb, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index c268604a4c9..d521b461d87 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.94 2014/05/04 17:34:17 sf Exp $ */ +/* $OpenBSD: mpii.c,v 1.95 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -609,7 +609,7 @@ mpii_attach(struct device *parent, struct device *self, void *aux) return; free_devs: - free(sc->sc_devs, M_DEVBUF); + free(sc->sc_devs, M_DEVBUF, 0); sc->sc_devs = NULL; free_queues: @@ -630,7 +630,7 @@ free_ccbs: while ((ccb = mpii_get_ccb(sc)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); mpii_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); unmap: bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios); @@ -1649,7 +1649,7 @@ mpii_event_raid(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) dev->slot = sc->sc_vd_id_low; dev->dev_handle = lemtoh16(&ce->vol_dev_handle); if (mpii_insert_dev(sc, dev)) { - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); break; } sc->sc_vd_count++; @@ -1743,7 +1743,7 @@ mpii_event_sas(void *xsc, void *x) dev->expander = lemtoh16(&tcl->expander_handle); if (mpii_insert_dev(sc, dev)) { - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); break; } @@ -1766,7 +1766,7 @@ mpii_event_sas(void *xsc, void *x) DETACH_FORCE); } - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); break; } } @@ -2277,7 +2277,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, mdm->mdm_map); mdmfree: - free(mdm, M_DEVBUF); + free(mdm, M_DEVBUF, 0); return (NULL); } @@ -2291,7 +2291,7 @@ mpii_dmamem_free(struct mpii_softc *sc, struct mpii_dmamem *mdm) bus_dmamem_unmap(sc->sc_dmat, mdm->mdm_kva, mdm->mdm_size); bus_dmamem_free(sc->sc_dmat, &mdm->mdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, mdm->mdm_map); - free(mdm, M_DEVBUF); + free(mdm, M_DEVBUF, 0); } int @@ -2423,7 +2423,7 @@ free_maps: mpii_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -2479,7 +2479,7 @@ mpii_alloc_replies(struct mpii_softc *sc) sc->sc_replies = mpii_dmamem_alloc(sc, sc->sc_reply_size * sc->sc_num_reply_frames); if (sc->sc_replies == NULL) { - free(sc->sc_rcbs, M_DEVBUF); + free(sc->sc_rcbs, M_DEVBUF, 0); return (1); } @@ -3081,7 +3081,7 @@ mpii_ioctl_cache(struct scsi_link *link, u_long cmd, struct dk_cache *dc) scsi_io_put(&sc->sc_iopool, ccb); done: - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (rv); } @@ -3168,7 +3168,7 @@ mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv) &hdr, 1, vpg, pagelen) != 0) { printf("%s: unable to fetch raid volume page 0\n", DEVNAME(sc)); - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (EINVAL); } @@ -3213,7 +3213,7 @@ mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv) } if ((rv = mpii_bio_hs(sc, NULL, 0, vpg->hot_spare_pool, &hcnt)) != 0) { - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (rv); } @@ -3227,7 +3227,7 @@ mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv) strlcpy(bv->bv_dev, scdev->dv_xname, sizeof(bv->bv_dev)); } - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (0); } @@ -3268,7 +3268,7 @@ mpii_ioctl_disk(struct mpii_softc *sc, struct bioc_disk *bd) &hdr, 1, vpg, pagelen) != 0) { printf("%s: unable to fetch raid volume page 0\n", DEVNAME(sc)); - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (EINVAL); } @@ -3276,7 +3276,7 @@ mpii_ioctl_disk(struct mpii_softc *sc, struct bioc_disk *bd) int nvdsk = vpg->num_phys_disks; int hsmap = vpg->hot_spare_pool; - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (mpii_bio_hs(sc, bd, nvdsk, hsmap, NULL)); } @@ -3284,7 +3284,7 @@ mpii_ioctl_disk(struct mpii_softc *sc, struct bioc_disk *bd) bd->bd_diskid; dn = pd->phys_disk_num; - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (mpii_bio_disk(sc, bd, dn)); } @@ -3324,7 +3324,7 @@ mpii_bio_hs(struct mpii_softc *sc, struct bioc_disk *bd, int nvdsk, MPII_PG_EXTENDED, &ehdr, 1, cpg, pagelen) != 0) { printf("%s: unable to fetch raid config page 0\n", DEVNAME(sc)); - free(cpg, M_TEMP); + free(cpg, M_TEMP, 0); return (EINVAL); } @@ -3343,7 +3343,7 @@ mpii_bio_hs(struct mpii_softc *sc, struct bioc_disk *bd, int nvdsk, if (bd != NULL && bd->bd_diskid == nhs + nvdsk) { u_int8_t dn = el->phys_disk_num; - free(cpg, M_TEMP); + free(cpg, M_TEMP, 0); return (mpii_bio_disk(sc, bd, dn)); } nhs++; @@ -3353,7 +3353,7 @@ mpii_bio_hs(struct mpii_softc *sc, struct bioc_disk *bd, int nvdsk, if (hscnt) *hscnt = nhs; - free(cpg, M_TEMP); + free(cpg, M_TEMP, 0); return (0); } @@ -3384,7 +3384,7 @@ mpii_bio_disk(struct mpii_softc *sc, struct bioc_disk *bd, u_int8_t dn) &hdr, 1, ppg, sizeof(*ppg)) != 0) { printf("%s: unable to fetch raid drive page 0\n", DEVNAME(sc)); - free(ppg, M_TEMP); + free(ppg, M_TEMP, 0); return (EINVAL); } @@ -3392,7 +3392,7 @@ mpii_bio_disk(struct mpii_softc *sc, struct bioc_disk *bd, u_int8_t dn) if ((dev = mpii_find_dev(sc, lemtoh16(&ppg->dev_handle))) == NULL) { bd->bd_status = BIOC_SDINVALID; - free(ppg, M_TEMP); + free(ppg, M_TEMP, 0); return (0); } @@ -3437,7 +3437,7 @@ mpii_bio_disk(struct mpii_softc *sc, struct bioc_disk *bd, u_int8_t dn) sizeof(ppg->product_id)); scsi_strvis(bd->bd_serial, ppg->serial, sizeof(ppg->serial)); - free(ppg, M_TEMP); + free(ppg, M_TEMP, 0); return (0); } @@ -3490,7 +3490,7 @@ mpii_bio_volstate(struct mpii_softc *sc, struct bioc_vol *bv) MPII_PG_POLL, &hdr, 1, vpg, pagelen) != 0) { DNPRINTF(MPII_D_MISC, "%s: unable to fetch raid volume " "page 0\n", DEVNAME(sc)); - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (EINVAL); } @@ -3518,7 +3518,7 @@ mpii_bio_volstate(struct mpii_softc *sc, struct bioc_vol *bv) break; } - free(vpg, M_TEMP); + free(vpg, M_TEMP, 0); return (0); } @@ -3563,7 +3563,7 @@ mpii_create_sensors(struct mpii_softc *sc) return (0); bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/pci/nofn.c b/sys/dev/pci/nofn.c index 1ca24142fab..490850c8162 100644 --- a/sys/dev/pci/nofn.c +++ b/sys/dev/pci/nofn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nofn.c,v 1.18 2011/01/12 17:01:26 deraadt Exp $ */ +/* $OpenBSD: nofn.c,v 1.19 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -201,7 +201,7 @@ nofn_intr(vsc) q = sc->sc_pk_current; sc->sc_pk_current = NULL; q->q_finish(sc, q); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); nofn_pk_feed(sc); } } @@ -409,7 +409,7 @@ nofn_pk_feed(sc) break; } else { SIMPLEQ_REMOVE_HEAD(&sc->sc_pk_queue, q_next); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); } } } @@ -452,7 +452,7 @@ nofn_pk_process(krp) sc->sc_dev.dv_xname, krp->krp_op); krp->krp_status = EOPNOTSUPP; crypto_kdone(krp); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); return (0); } } diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 48d7d125918..5b50113818c 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbb.c,v 1.91 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: pccbb.c,v 1.92 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */ /* @@ -1565,7 +1565,7 @@ pccbb_intr_disestablish(struct pccbb_softc *sc, void *ih) if (pil == ih) { evcount_detach(&pil->pil_count); *pil_prev = pil->pil_next; - free(pil, M_DEVBUF); + free(pil, M_DEVBUF, 0); DPRINTF(("pccbb_intr_disestablish frees one pil\n")); break; } @@ -2670,7 +2670,7 @@ pccbb_winlist_delete(struct pccbb_win_chain_head *head, bus_space_handle_t bsh, } TAILQ_REMOVE(head, chainp, wc_list); - free(chainp, M_DEVBUF); + free(chainp, M_DEVBUF, 0); return 0; } diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 80265afb75e..4a226d4f968 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.102 2014/05/04 20:09:15 sf Exp $ */ +/* $OpenBSD: pci.c,v 1.103 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: pci.c,v 1.31 1997/06/06 23:48:04 thorpej Exp $ */ /* @@ -577,7 +577,7 @@ pci_detach_devices(struct pci_softc *sc, int flags) for (pd = LIST_FIRST(&sc->sc_devs); pd != LIST_END(&sc->sc_devs); pd = next) { next = LIST_NEXT(pd, pd_next); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); } LIST_INIT(&sc->sc_devs); diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c index 18cf49e2184..e141c3c36cd 100644 --- a/sys/dev/pci/pciide.c +++ b/sys/dev/pci/pciide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide.c,v 1.345 2014/04/24 15:38:25 jsg Exp $ */ +/* $OpenBSD: pciide.c,v 1.346 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */ /* @@ -2532,7 +2532,7 @@ default_chip_unmap(struct pciide_softc *sc, int flags) pciide_unmapreg_dma(sc); if (sc->sc_cookie) - free(sc->sc_cookie, M_DEVBUF); + free(sc->sc_cookie, M_DEVBUF, 0); } void diff --git a/sys/dev/pci/ppb.c b/sys/dev/pci/ppb.c index b846fd44487..b95b780b4fe 100644 --- a/sys/dev/pci/ppb.c +++ b/sys/dev/pci/ppb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppb.c,v 1.57 2014/01/29 18:30:39 kettenis Exp $ */ +/* $OpenBSD: ppb.c,v 1.58 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ppb.c,v 1.16 1997/06/06 23:48:05 thorpej Exp $ */ /* @@ -337,19 +337,19 @@ ppbdetach(struct device *self, int flags) if (sc->sc_ioex) { name = sc->sc_ioex->ex_name; extent_destroy(sc->sc_ioex); - free(name, M_DEVBUF); + free(name, M_DEVBUF, 0); } if (sc->sc_memex) { name = sc->sc_memex->ex_name; extent_destroy(sc->sc_memex); - free(name, M_DEVBUF); + free(name, M_DEVBUF, 0); } if (sc->sc_pmemex) { name = sc->sc_pmemex->ex_name; extent_destroy(sc->sc_pmemex); - free(name, M_DEVBUF); + free(name, M_DEVBUF, 0); } return (rv); diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 3ab2e5f6578..91a1f6691d1 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.29 2014/05/21 22:59:26 jmatthew Exp $ */ +/* $OpenBSD: qle.c,v 1.30 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -902,11 +902,11 @@ qle_add_loop_port(struct qle_softc *sc, struct qle_fc_port *port) sc->sc_targets[port->loopid] = port; break; case QLE_PORT_DISP_DUP: - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); break; case QLE_PORT_DISP_SAME: TAILQ_REMOVE(&sc->sc_ports_gone, pport, update); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); break; } mtx_leave(&sc->sc_port_mtx); @@ -932,7 +932,7 @@ qle_add_fabric_port(struct qle_softc *sc, struct qle_fc_port *port) struct qle_get_port_db *pdb; if (qle_get_port_db(sc, port->loopid, sc->sc_scratch) != 0) { - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); return (1); } pdb = QLE_DMA_KVA(sc->sc_scratch); @@ -1619,13 +1619,13 @@ qle_clear_port_lists(struct qle_softc *sc) while (!TAILQ_EMPTY(&sc->sc_ports_found)) { p = TAILQ_FIRST(&sc->sc_ports_found); TAILQ_REMOVE(&sc->sc_ports_found, p, update); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!TAILQ_EMPTY(&sc->sc_ports_new)) { p = TAILQ_FIRST(&sc->sc_ports_new); TAILQ_REMOVE(&sc->sc_ports_new, p, update); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!TAILQ_EMPTY(&sc->sc_ports_gone)) { @@ -2115,7 +2115,7 @@ qle_do_update(void *xsc, void *x) if (port->location & QLE_LOCATION_FABRIC) qle_fabric_plogo(sc, port); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } qle_update_done(sc, QLE_UPDATE_TASK_CLEAR_ALL); @@ -2207,12 +2207,12 @@ qle_do_update(void *xsc, void *x) DPRINTF(QLE_D_PORT, "%s: loop port %04x\n", DEVNAME(sc), fport->loopid); if (qle_add_loop_port(sc, fport) != 0) - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); } else if (fport->location & QLE_LOCATION_FABRIC) { qle_add_fabric_port(sc, fport); } else { /* already processed */ - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); } continue; } @@ -2250,7 +2250,7 @@ qle_do_update(void *xsc, void *x) fport, update); break; case QLE_PORT_DISP_DUP: - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); break; case QLE_PORT_DISP_SAME: DPRINTF(QLE_D_PORT, "%s: existing port " @@ -2258,7 +2258,7 @@ qle_do_update(void *xsc, void *x) fport->portid); TAILQ_REMOVE(&sc->sc_ports_gone, port, update); - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); break; } mtx_leave(&sc->sc_port_mtx); @@ -2291,7 +2291,7 @@ qle_do_update(void *xsc, void *x) DPRINTF(QLE_D_PORT, "%s: plogi %06x " "failed\n", DEVNAME(sc), port->portid); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } } else { DPRINTF(QLE_D_PORT, "%s: done with logins\n", @@ -2339,7 +2339,7 @@ qle_do_update(void *xsc, void *x) if (port->location & QLE_LOCATION_FABRIC) qle_fabric_plogo(sc, port); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } else { DPRINTF(QLE_D_PORT, "%s: nothing to detach\n", DEVNAME(sc)); @@ -2816,7 +2816,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); qdmfree: - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return (NULL); } @@ -2828,7 +2828,7 @@ qle_dmamem_free(struct qle_softc *sc, struct qle_dmamem *m) bus_dmamem_unmap(sc->sc_dmat, m->qdm_kva, m->qdm_size); bus_dmamem_free(sc->sc_dmat, &m->qdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); } int @@ -2923,7 +2923,7 @@ free_res: free_req: qle_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -2939,7 +2939,7 @@ qle_free_ccbs(struct qle_softc *sc) qle_dmamem_free(sc, sc->sc_segments); qle_dmamem_free(sc, sc->sc_responses); qle_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); } void * diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index 451648e2e89..25359933fd0 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.35 2012/12/05 23:20:20 deraadt Exp $ */ +/* $OpenBSD: safe.c,v 1.36 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -1352,7 +1352,7 @@ safe_newsession(u_int32_t *sidp, struct cryptoini *cri) sizeof(struct safe_session)); explicit_bzero(sc->sc_sessions, sesn * sizeof(struct safe_session)); - 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++; @@ -1949,7 +1949,7 @@ safe_kfeed(struct safe_softc *sc) SIMPLEQ_REMOVE_HEAD(&sc->sc_pkq, pkq_next); if (safe_kstart(sc) != 0) { crypto_kdone(q->pkq_krp); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); sc->sc_pkq_cur = NULL; } else { /* op started, start polling */ @@ -1993,7 +1993,7 @@ safe_kpoll(void *vsc) explicit_bzero(&buf, sizeof(buf)); crypto_kdone(q->pkq_krp); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); sc->sc_pkq_cur = NULL; safe_kfeed(sc); diff --git a/sys/dev/pci/sv.c b/sys/dev/pci/sv.c index c39fc48c489..5fef1c652cb 100644 --- a/sys/dev/pci/sv.c +++ b/sys/dev/pci/sv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sv.c,v 1.30 2013/11/15 16:46:27 brad Exp $ */ +/* $OpenBSD: sv.c,v 1.31 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 1998 Constantine Paul Sapuntzakis @@ -1395,7 +1395,7 @@ sv_malloc(void *addr, int direction, size_t size, int pool, int flags) return (0); error = sv_allocmem(sc, size, 16, p); if (error) { - free(p, pool); + free(p, pool, 0); return (0); } p->next = sc->sc_dmas; @@ -1413,7 +1413,7 @@ sv_free(void *addr, void *ptr, int pool) if (KERNADDR(*p) == ptr) { sv_freemem(sc, *p); *p = (*p)->next; - free(*p, pool); + free(*p, pool, 0); return; } } diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index e9f765e6719..20f36157f2b 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.157 2014/05/04 20:09:15 sf Exp $ */ +/* $OpenBSD: ubsec.c,v 1.158 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -271,7 +271,7 @@ ubsec_attach(struct device *parent, struct device *self, void *aux) if (ubsec_dma_malloc(sc, sizeof(struct ubsec_dmachunk), &dmap->d_alloc, 0)) { printf(": can't allocate dma buffers\n"); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); break; } dmap->d_dma = (struct ubsec_dmachunk *)dmap->d_alloc.dma_vaddr; @@ -701,7 +701,7 @@ ubsec_newsession(u_int32_t *sidp, struct cryptoini *cri) sizeof(struct ubsec_session)); explicit_bzero(sc->sc_sessions, sesn * sizeof(struct ubsec_session)); - 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++; @@ -1880,7 +1880,7 @@ ubsec_kfree(struct ubsec_softc *sc, struct ubsec_q2 *q) ubsec_dma_free(sc, &me->me_E); ubsec_dma_free(sc, &me->me_C); ubsec_dma_free(sc, &me->me_epb); - free(me, M_DEVBUF); + free(me, M_DEVBUF, 0); break; } case UBS_CTXOP_RSAPRIV: { @@ -1890,7 +1890,7 @@ ubsec_kfree(struct ubsec_softc *sc, struct ubsec_q2 *q) ubsec_dma_free(sc, &rp->rpr_q.q_ctx); ubsec_dma_free(sc, &rp->rpr_msgin); ubsec_dma_free(sc, &rp->rpr_msgout); - free(rp, M_DEVBUF); + free(rp, M_DEVBUF, 0); break; } default: @@ -2131,7 +2131,7 @@ errout: } if (me->me_epb.dma_map != NULL) ubsec_dma_free(sc, &me->me_epb); - free(me, M_DEVBUF); + free(me, M_DEVBUF, 0); } krp->krp_status = err; crypto_kdone(krp); @@ -2330,7 +2330,7 @@ errout: } if (me->me_epb.dma_map != NULL) ubsec_dma_free(sc, &me->me_epb); - free(me, M_DEVBUF); + free(me, M_DEVBUF, 0); } krp->krp_status = err; crypto_kdone(krp); @@ -2516,7 +2516,7 @@ errout: rp->rpr_msgout.dma_size); ubsec_dma_free(sc, &rp->rpr_msgout); } - free(rp, M_DEVBUF); + free(rp, M_DEVBUF, 0); } krp->krp_status = err; crypto_kdone(krp); diff --git a/sys/dev/pci/vga_pci_common.c b/sys/dev/pci/vga_pci_common.c index bf692827133..9f4567bb38a 100644 --- a/sys/dev/pci/vga_pci_common.c +++ b/sys/dev/pci/vga_pci_common.c @@ -73,7 +73,7 @@ vga_pci_bar_init(struct vga_pci_softc *dev, struct pci_attach_args *pa) if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, addr, dev->bars[i]->maptype, &dev->bars[i]->base, &dev->bars[i]->maxsize, &dev->bars[i]->flags) != 0) { - free(dev->bars[i], M_DEVBUF); + free(dev->bars[i], M_DEVBUF, 0); dev->bars[i] = NULL; } diff --git a/sys/dev/pci/virtio.c b/sys/dev/pci/virtio.c index 257b23180c5..d353b15d401 100644 --- a/sys/dev/pci/virtio.c +++ b/sys/dev/pci/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.7 2014/06/26 07:46:17 jasper Exp $ */ +/* $OpenBSD: virtio.c,v 1.8 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */ /* @@ -430,7 +430,7 @@ virtio_free_vq(struct virtio_softc *sc, struct virtqueue *vq) /* tell device that there's no virtqueue any longer */ virtio_setup_queue(sc, vq->vq_index, 0); - free(vq->vq_entries, M_DEVBUF); + free(vq->vq_entries, M_DEVBUF, 0); bus_dmamap_unload(sc->sc_dmat, vq->vq_dmamap); bus_dmamap_destroy(sc->sc_dmat, vq->vq_dmamap); bus_dmamem_unmap(sc->sc_dmat, vq->vq_vaddr, vq->vq_bytesize); diff --git a/sys/dev/pci/vmwpvs.c b/sys/dev/pci/vmwpvs.c index 57fd0f6175f..a1a90a17eef 100644 --- a/sys/dev/pci/vmwpvs.c +++ b/sys/dev/pci/vmwpvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmwpvs.c,v 1.8 2013/10/30 02:11:32 dlg Exp $ */ +/* $OpenBSD: vmwpvs.c,v 1.9 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2013 David Gwynne <dlg@openbsd.org> @@ -581,7 +581,7 @@ vmwpvs_attach(struct device *parent, struct device *self, void *aux) free_ccbs: while ((ccb = vmwpvs_ccb_get(sc)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); /* free_sense: */ vmwpvs_dmamem_free(sc, sc->sc_sense); free_sgl: @@ -1138,7 +1138,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, dm->dm_map); dmfree: - free(dm, M_DEVBUF); + free(dm, M_DEVBUF, 0); return (NULL); } @@ -1164,5 +1164,5 @@ vmwpvs_dmamem_free(struct vmwpvs_softc *sc, struct vmwpvs_dmamem *dm) bus_dmamem_unmap(sc->sc_dmat, dm->dm_kva, dm->dm_size); bus_dmamem_free(sc->sc_dmat, &dm->dm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, dm->dm_map); - free(dm, M_DEVBUF); + free(dm, M_DEVBUF, 0); } diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index 8cce53f4637..61158ea5e26 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.46 2014/05/17 12:19:36 ratchov Exp $ */ +/* $OpenBSD: yds.c,v 1.47 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -367,19 +367,19 @@ yds_download_mcode(struct yds_softc *sc) p = (u_int32_t *)&yf->data[ntohl(yf->dsplen) + ntohl(yf->ds1len)]; size = ntohl(yf->ds1elen); } else { - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return 1; /* unknown */ } if (size > buflen) { printf("%s: old firmware file, update please\n", sc->sc_dev.dv_xname); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return 1; } if (yds_disable_dsp(sc)) { - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return 1; } @@ -409,7 +409,7 @@ yds_download_mcode(struct yds_softc *sc) yds_enable_dsp(sc); delay(10*1000); /* neccesary on my 724F (??) */ - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return 0; } @@ -458,7 +458,7 @@ yds_allocate_slots(struct yds_softc *sc, int resuming) if (i) { printf("%s: couldn't alloc/map DSP DMA buffer, reason %d\n", sc->sc_dev.dv_xname, i); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return 1; } } @@ -1660,7 +1660,7 @@ yds_malloc(void *addr, int direction, size_t size, int pool, int flags) return (0); error = yds_allocmem(sc, size, 16, p); if (error) { - free(p, pool); + free(p, pool, 0); return (0); } p->next = sc->sc_dmas; @@ -1678,7 +1678,7 @@ yds_free(void *addr, void *ptr, int pool) if (KERNADDR(p) == ptr) { yds_freemem(sc, p); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } } |