From df2ac69f82ae44a202c3df500ca0878a86fb544f Mon Sep 17 00:00:00 2001 From: tedu Date: Sat, 12 Jul 2014 18:48:51 +0000 Subject: [PATCH] add a size argument to free. will be used soon, but for now default to 0. after discussions with beck deraadt kettenis. --- sys/dev/onewire/onewire.c | 4 +- sys/dev/onewire/owctr.c | 4 +- sys/dev/pci/agp.c | 18 ++--- sys/dev/pci/agp_amd.c | 6 +- sys/dev/pci/agp_i810.c | 16 ++--- sys/dev/pci/ahd_pci.c | 4 +- sys/dev/pci/arc.c | 32 ++++----- sys/dev/pci/auacer.c | 6 +- sys/dev/pci/auglx.c | 6 +- sys/dev/pci/auich.c | 6 +- sys/dev/pci/auixp.c | 8 +-- sys/dev/pci/autri.c | 6 +- sys/dev/pci/auvia.c | 6 +- sys/dev/pci/azalia.c | 26 ++++---- sys/dev/pci/azalia_codec.c | 6 +- sys/dev/pci/cmpci.c | 6 +- sys/dev/pci/cs4280.c | 12 ++-- sys/dev/pci/cs4281.c | 8 +-- sys/dev/pci/drm/drmP.h | 6 +- sys/dev/pci/drm/drm_drv.c | 6 +- sys/dev/pci/drm/drm_edid.c | 6 +- sys/dev/pci/drm/drm_mem_util.h | 6 +- sys/dev/pci/drm/drm_memory.c | 6 +- sys/dev/pci/drm/i915/i915_gem.c | 4 +- sys/dev/pci/drm/i915/i915_gem_context.c | 4 +- sys/dev/pci/drm/i915/i915_gem_execbuffer.c | 6 +- sys/dev/pci/drm/i915/i915_irq.c | 8 +-- sys/dev/pci/drm/i915/intel_hdmi.c | 8 +-- sys/dev/pci/drm/i915/intel_modes.c | 4 +- sys/dev/pci/drm/radeon/ni.c | 10 +-- sys/dev/pci/drm/radeon/r100.c | 4 +- sys/dev/pci/drm/radeon/r600.c | 8 +-- sys/dev/pci/drm/radeon/radeon_ttm.c | 10 +-- sys/dev/pci/drm/radeon/si.c | 12 ++-- sys/dev/pci/eap.c | 6 +- sys/dev/pci/emuxki.c | 16 ++--- sys/dev/pci/esa.c | 10 +-- sys/dev/pci/eso.c | 6 +- sys/dev/pci/fms.c | 6 +- sys/dev/pci/hifn7751.c | 16 ++--- sys/dev/pci/if_bge.c | 4 +- sys/dev/pci/if_bnx.c | 12 ++-- sys/dev/pci/if_em.c | 6 +- sys/dev/pci/if_ipw.c | 8 +-- sys/dev/pci/if_iwi.c | 6 +- sys/dev/pci/if_iwn.c | 14 ++-- sys/dev/pci/if_ix.c | 14 ++-- sys/dev/pci/if_ixgb.c | 6 +- sys/dev/pci/if_msk.c | 4 +- sys/dev/pci/if_myx.c | 4 +- sys/dev/pci/if_nxe.c | 18 ++--- sys/dev/pci/if_oce.c | 38 +++++------ sys/dev/pci/if_san_common.c | 6 +- sys/dev/pci/if_san_xilinx.c | 8 +-- sys/dev/pci/if_sandrv.c | 8 +-- sys/dev/pci/if_sk.c | 4 +- sys/dev/pci/if_tht.c | 10 +-- sys/dev/pci/if_txp.c | 18 ++--- sys/dev/pci/if_vic.c | 6 +- sys/dev/pci/if_vio.c | 4 +- sys/dev/pci/if_wpi.c | 12 ++-- sys/dev/pci/ips.c | 8 +-- sys/dev/pci/isp_pci.c | 22 +++---- sys/dev/pci/lofn.c | 8 +-- sys/dev/pci/maestro.c | 4 +- sys/dev/pci/mfii.c | 8 +-- sys/dev/pci/mpii.c | 52 +++++++-------- sys/dev/pci/nofn.c | 8 +-- sys/dev/pci/pccbb.c | 6 +- sys/dev/pci/pci.c | 4 +- sys/dev/pci/pciide.c | 4 +- sys/dev/pci/ppb.c | 8 +-- sys/dev/pci/qle.c | 34 +++++----- sys/dev/pci/safe.c | 8 +-- sys/dev/pci/sv.c | 6 +- sys/dev/pci/ubsec.c | 16 ++--- sys/dev/pci/vga_pci_common.c | 2 +- sys/dev/pci/virtio.c | 4 +- sys/dev/pci/vmwpvs.c | 8 +-- sys/dev/pci/yds.c | 16 ++--- sys/dev/pckbc/pms.c | 14 ++-- sys/dev/pcmcia/cfxga.c | 10 +-- sys/dev/pcmcia/if_malo.c | 12 ++-- sys/dev/pcmcia/if_xe.c | 4 +- sys/dev/pcmcia/pcmcia_cis.c | 4 +- sys/dev/pcmcia/pcmcia_cis_quirks.c | 6 +- sys/dev/rasops/rasops.c | 8 +-- sys/dev/rd.c | 4 +- sys/dev/rnd.c | 6 +- sys/dev/sbus/cs4231.c | 6 +- sys/dev/sbus/isp_sbus.c | 12 ++-- sys/dev/sbus/magma.c | 4 +- sys/dev/sbus/qla_sbus.c | 4 +- sys/dev/sdmmc/sdhc.c | 4 +- sys/dev/sdmmc/sdmmc.c | 6 +- sys/dev/sdmmc/sdmmc_io.c | 4 +- sys/dev/sdmmc/sdmmc_mem.c | 4 +- sys/dev/sdmmc/sdmmc_scsi.c | 12 ++-- sys/dev/softraid.c | 76 +++++++++++----------- sys/dev/softraid_aoe.c | 16 ++--- sys/dev/softraid_crypto.c | 24 +++---- sys/dev/softraid_raid6.c | 4 +- sys/dev/systrace.c | 18 ++--- sys/dev/tc/bba.c | 4 +- sys/dev/usb/ezload.c | 4 +- sys/dev/usb/hid.c | 4 +- sys/dev/usb/hidkbd.c | 4 +- sys/dev/usb/if_athn_usb.c | 8 +-- sys/dev/usb/if_atu.c | 12 ++-- sys/dev/usb/if_kue.c | 12 ++-- sys/dev/usb/if_otus.c | 6 +- sys/dev/usb/if_rsu.c | 4 +- sys/dev/usb/if_rum.c | 4 +- sys/dev/usb/if_run.c | 6 +- sys/dev/usb/if_uath.c | 4 +- sys/dev/usb/if_upgt.c | 4 +- sys/dev/usb/if_urndis.c | 26 ++++---- sys/dev/usb/if_urtwn.c | 4 +- sys/dev/usb/if_wi_usb.c | 6 +- sys/dev/usb/if_zyd.c | 6 +- sys/dev/usb/uaudio.c | 26 ++++---- sys/dev/usb/ubcmtp.c | 10 +-- sys/dev/usb/ubsa.c | 6 +- sys/dev/usb/uchcom.c | 4 +- sys/dev/usb/ucycom.c | 6 +- sys/dev/usb/udl.c | 10 +-- sys/dev/usb/ugen.c | 26 ++++---- sys/dev/usb/uhci.c | 10 +-- sys/dev/usb/uhid.c | 4 +- sys/dev/usb/uhidev.c | 14 ++-- sys/dev/usb/uhub.c | 18 ++--- sys/dev/usb/ulpt.c | 4 +- sys/dev/usb/umass.c | 4 +- sys/dev/usb/umct.c | 6 +- sys/dev/usb/umidi.c | 12 ++-- sys/dev/usb/umsm.c | 6 +- sys/dev/usb/uoaklux.c | 4 +- sys/dev/usb/uoakrh.c | 4 +- sys/dev/usb/uoakv.c | 4 +- sys/dev/usb/upd.c | 6 +- sys/dev/usb/uplcom.c | 6 +- sys/dev/usb/urio.c | 4 +- sys/dev/usb/usb.c | 8 +-- sys/dev/usb/usb_mem.c | 6 +- sys/dev/usb/usb_subr.c | 34 +++++----- sys/dev/usb/usbdi.c | 6 +- sys/dev/usb/usbf_subr.c | 30 ++++----- sys/dev/usb/usps.c | 6 +- sys/dev/usb/uticom.c | 12 ++-- sys/dev/usb/utrh.c | 4 +- sys/dev/usb/uts.c | 6 +- sys/dev/usb/utwitch.c | 4 +- sys/dev/usb/uvideo.c | 24 +++---- sys/dev/usb/uvscom.c | 6 +- sys/dev/video.c | 4 +- sys/dev/vmt.c | 4 +- sys/dev/vnd.c | 8 +-- sys/dev/vscsi.c | 4 +- sys/dev/wscons/wsdisplay.c | 16 ++--- sys/dev/wscons/wsdisplay_compat_usl.c | 6 +- sys/dev/wscons/wsemul_dumb.c | 4 +- sys/dev/wscons/wsemul_sun.c | 4 +- sys/dev/wscons/wsemul_vt100.c | 6 +- sys/dev/wscons/wsevent.c | 4 +- sys/dev/wscons/wskbd.c | 6 +- sys/dev/wscons/wskbdutil.c | 4 +- sys/dev/wscons/wsmux.c | 4 +- sys/dev/wsfont/wsfont.c | 12 ++-- 168 files changed, 795 insertions(+), 795 deletions(-) diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c index 7cf3eff1875..cd7f94bbe4c 100644 --- a/sys/dev/onewire/onewire.c +++ b/sys/dev/onewire/onewire.c @@ -1,4 +1,4 @@ -/* $OpenBSD: onewire.c,v 1.14 2013/11/18 20:21:51 deraadt Exp $ */ +/* $OpenBSD: onewire.c,v 1.15 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko @@ -494,7 +494,7 @@ out: if (d->d_dev != NULL) config_detach(d->d_dev, DETACH_FORCE); TAILQ_REMOVE(&sc->sc_devs, d, d_list); - free(d, M_DEVBUF); + free(d, M_DEVBUF, 0); } } } diff --git a/sys/dev/onewire/owctr.c b/sys/dev/onewire/owctr.c index 918c41cadc7..5b47ac922bb 100644 --- a/sys/dev/onewire/owctr.c +++ b/sys/dev/onewire/owctr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: owctr.c,v 1.4 2010/07/19 23:44:09 deraadt Exp $ */ +/* $OpenBSD: owctr.c,v 1.5 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2010 John L. Scarfone * @@ -213,7 +213,7 @@ owctr_update_counter(void *arg, int bank) } onewire_reset(sc->sc_onewire); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); done: onewire_unlock(sc->sc_onewire); 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 @@ -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 @@ -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 * 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 * @@ -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 * @@ -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 * 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 * 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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; } } diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c index 4799c8c7438..77904ae771e 100644 --- a/sys/dev/pckbc/pms.c +++ b/sys/dev/pckbc/pms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pms.c,v 1.51 2014/05/18 15:27:28 stsp Exp $ */ +/* $OpenBSD: pms.c,v 1.52 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */ /*- @@ -992,7 +992,7 @@ pms_enable_synaptics(struct pms_softc *sc) } if (synaptics_get_hwinfo(sc)) { - free(sc->synaptics, M_DEVBUF); + free(sc->synaptics, M_DEVBUF, 0); sc->synaptics = NULL; goto err; } @@ -1273,7 +1273,7 @@ pms_enable_alps(struct pms_softc *sc) } if (alps_get_hwinfo(sc)) { - free(sc->alps, M_DEVBUF); + free(sc->alps, M_DEVBUF, 0); sc->alps = NULL; goto err; } @@ -1828,7 +1828,7 @@ pms_enable_elantech_v1(struct pms_softc *sc) } if (elantech_get_hwinfo_v1(sc)) { - free(sc->elantech, M_DEVBUF); + free(sc->elantech, M_DEVBUF, 0); sc->elantech = NULL; goto err; } @@ -1867,7 +1867,7 @@ pms_enable_elantech_v2(struct pms_softc *sc) } if (elantech_get_hwinfo_v2(sc)) { - free(sc->elantech, M_DEVBUF); + free(sc->elantech, M_DEVBUF, 0); sc->elantech = NULL; goto err; } @@ -1903,7 +1903,7 @@ pms_enable_elantech_v3(struct pms_softc *sc) } if (elantech_get_hwinfo_v3(sc)) { - free(sc->elantech, M_DEVBUF); + free(sc->elantech, M_DEVBUF, 0); sc->elantech = NULL; goto err; } @@ -1939,7 +1939,7 @@ pms_enable_elantech_v4(struct pms_softc *sc) } if (elantech_get_hwinfo_v4(sc)) { - free(sc->elantech, M_DEVBUF); + free(sc->elantech, M_DEVBUF, 0); sc->elantech = NULL; goto err; } diff --git a/sys/dev/pcmcia/cfxga.c b/sys/dev/pcmcia/cfxga.c index e9f041f0f27..88593d1fd33 100644 --- a/sys/dev/pcmcia/cfxga.c +++ b/sys/dev/pcmcia/cfxga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfxga.c,v 1.27 2014/01/22 02:58:35 jsg Exp $ */ +/* $OpenBSD: cfxga.c,v 1.28 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat @@ -254,7 +254,7 @@ cfxga_remove_function(struct pcmcia_function *pf) /* we are the first and only entry... */ cfe = SIMPLEQ_FIRST(&pf->cfe_head); SIMPLEQ_REMOVE_HEAD(&pf->cfe_head, cfe_list); - free(cfe, M_DEVBUF); + free(cfe, M_DEVBUF, 0); /* And we're a figment of the kernel's imagination again. */ pf->pf_flags |= PFF_FAKE; @@ -505,7 +505,7 @@ cfxga_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, scr->scr_mem = malloc(scrsize, M_DEVBUF, (cold ? M_NOWAIT : M_WAITOK) | M_ZERO); if (scr->scr_mem == NULL) { - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return (ENOMEM); } @@ -572,8 +572,8 @@ cfxga_free_screen(void *v, void *cookie) cfxga_burner(sc, 0, 0); } - free(scr->scr_mem, M_DEVBUF); - free(scr, M_DEVBUF); + free(scr->scr_mem, M_DEVBUF, 0); + free(scr, M_DEVBUF, 0); } int diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index 2f9808994be..7767e016211 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_malo.c,v 1.77 2014/05/04 20:09:15 sf Exp $ */ +/* $OpenBSD: if_malo.c,v 1.78 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -456,7 +456,7 @@ cmalo_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (nr) - free(nr, M_DEVBUF); + free(nr, M_DEVBUF, 0); break; default: error = ieee80211_ioctl(ifp, cmd, data); @@ -510,12 +510,12 @@ void cmalo_fw_free(struct malo_softc *sc) { if (sc->sc_fw_h != NULL) { - free(sc->sc_fw_h, M_DEVBUF); + free(sc->sc_fw_h, M_DEVBUF, 0); sc->sc_fw_h = NULL; } if (sc->sc_fw_m != NULL) { - free(sc->sc_fw_m, M_DEVBUF); + free(sc->sc_fw_m, M_DEVBUF, 0); sc->sc_fw_m = NULL; } } @@ -839,11 +839,11 @@ cmalo_detach(void *arg) /* free command buffer */ if (sc->sc_cmd != NULL) - free(sc->sc_cmd, M_DEVBUF); + free(sc->sc_cmd, M_DEVBUF, 0); /* free data buffer */ if (sc->sc_data != NULL) - free(sc->sc_data, M_DEVBUF); + free(sc->sc_data, M_DEVBUF, 0); /* free firmware */ cmalo_fw_free(sc); diff --git a/sys/dev/pcmcia/if_xe.c b/sys/dev/pcmcia/if_xe.c index 2417b08fe16..6f48ccf51e3 100644 --- a/sys/dev/pcmcia/if_xe.c +++ b/sys/dev/pcmcia/if_xe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xe.c,v 1.43 2013/11/26 09:50:33 mpi Exp $ */ +/* $OpenBSD: if_xe.c,v 1.44 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist, Brandon Creighton, Job de Haas @@ -428,7 +428,7 @@ bad: pcmcia_io_free(pf, &psc->sc_pcioh); if (state > 0) pcmcia_function_disable(pa->pf); - free(cfe, M_DEVBUF); + free(cfe, M_DEVBUF, 0); } int diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c index f1e8df5477b..86677f8119b 100644 --- a/sys/dev/pcmcia/pcmcia_cis.c +++ b/sys/dev/pcmcia/pcmcia_cis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_cis.c,v 1.19 2013/07/10 05:36:40 brad Exp $ */ +/* $OpenBSD: pcmcia_cis.c,v 1.20 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: pcmcia_cis.c,v 1.9 1998/08/22 23:41:48 msaitoh Exp $ */ /* @@ -725,7 +725,7 @@ pcmcia_parse_cis_tuple(tuple, arg) for (pf = SIMPLEQ_FIRST(&state->card->pf_head); pf != NULL; pf = pfnext) { pfnext = SIMPLEQ_NEXT(pf, pf_list); - free(pf, M_DEVBUF); + free(pf, M_DEVBUF, 0); } SIMPLEQ_INIT(&state->card->pf_head); diff --git a/sys/dev/pcmcia/pcmcia_cis_quirks.c b/sys/dev/pcmcia/pcmcia_cis_quirks.c index 93789b7aa24..05e4d00f923 100644 --- a/sys/dev/pcmcia/pcmcia_cis_quirks.c +++ b/sys/dev/pcmcia/pcmcia_cis_quirks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcmcia_cis_quirks.c,v 1.9 2011/03/31 13:05:27 jasper Exp $ */ +/* $OpenBSD: pcmcia_cis_quirks.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: pcmcia_cis_quirks.c,v 1.3 1998/12/29 09:00:28 marc Exp $ */ /* @@ -252,10 +252,10 @@ void pcmcia_check_cis_quirks(sc) for (cfe = SIMPLEQ_FIRST(&pf->cfe_head); cfe != NULL; cfe = cfe_next) { cfe_next = SIMPLEQ_NEXT(cfe, cfe_list); - free(cfe, M_DEVBUF); + free(cfe, M_DEVBUF, 0); } pf_next = SIMPLEQ_NEXT(pf, pf_list); - free(pf, M_DEVBUF); + free(pf, M_DEVBUF, 0); } SIMPLEQ_INIT(&sc->card.pf_head); diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 1d561e6a23b..66e9c1d95f7 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.30 2013/10/20 21:24:00 miod Exp $ */ +/* $OpenBSD: rasops.c,v 1.31 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -1380,7 +1380,7 @@ rasops_alloc_screen(void *v, void **cookiep, size = ri->ri_rows * ri->ri_cols * sizeof(struct wsdisplay_charcell); scr->rs_bs = malloc(size, M_DEVBUF, M_NOWAIT); if (scr->rs_bs == NULL) { - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return (ENOMEM); } @@ -1414,8 +1414,8 @@ rasops_free_screen(void *v, void *cookie) LIST_REMOVE(scr, rs_next); ri->ri_nscreens--; - free(scr->rs_bs, M_DEVBUF); - free(scr, M_DEVBUF); + free(scr->rs_bs, M_DEVBUF, 0); + free(scr, M_DEVBUF, 0); } int diff --git a/sys/dev/rd.c b/sys/dev/rd.c index 6e626b05dfc..bf2f63715e8 100644 --- a/sys/dev/rd.c +++ b/sys/dev/rd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rd.c,v 1.6 2013/06/11 16:42:13 deraadt Exp $ */ +/* $OpenBSD: rd.c,v 1.7 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2011 Matthew Dempsky @@ -265,7 +265,7 @@ rdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); rdgetdisklabel(dev, sc, lp, 0); bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); goto done; case DIOCGPDINFO: diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index d6414b6de34..a6afe5d1be5 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.157 2014/06/14 18:01:42 deraadt Exp $ */ +/* $OpenBSD: rnd.c,v 1.158 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2011 Theo de Raadt. @@ -842,7 +842,7 @@ randomread(dev_t dev, struct uio *uio, int ioflag) if (myctx) explicit_bzero(&lctx, sizeof(lctx)); explicit_bzero(buf, POOLBYTES); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return ret; } @@ -875,7 +875,7 @@ randomwrite(dev_t dev, struct uio *uio, int flags) arc4_init(NULL, NULL); explicit_bzero(buf, POOLBYTES); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return ret; } diff --git a/sys/dev/sbus/cs4231.c b/sys/dev/sbus/cs4231.c index d569da895cc..e8d2cb1940c 100644 --- a/sys/dev/sbus/cs4231.c +++ b/sys/dev/sbus/cs4231.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4231.c,v 1.32 2013/05/15 08:29:24 ratchov Exp $ */ +/* $OpenBSD: cs4231.c,v 1.33 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -1469,7 +1469,7 @@ fail2: fail1: bus_dmamap_destroy(dmat, p->dmamap); fail: - free(p, pool); + free(p, pool, 0); return (NULL); } @@ -1488,7 +1488,7 @@ cs4231_free(void *vsc, void *ptr, int pool) bus_dmamem_free(dmat, p->segs, p->nsegs); bus_dmamap_destroy(dmat, p->dmamap); *pp = p->next; - free(p, pool); + free(p, pool, 0); return; } printf("%s: attempt to free rogue pointer\n", sc->sc_dev.dv_xname); diff --git a/sys/dev/sbus/isp_sbus.c b/sys/dev/sbus/isp_sbus.c index 378740e47c0..45d380baa23 100644 --- a/sys/dev/sbus/isp_sbus.c +++ b/sys/dev/sbus/isp_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isp_sbus.c,v 1.20 2014/02/14 14:00:08 jmatthew Exp $ */ +/* $OpenBSD: isp_sbus.c,v 1.21 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: isp_sbus.c,v 1.46 2001/09/26 20:53:14 eeh Exp $ */ /* * SBus specific probe and attach routines for QLogic ISP SCSI adapters. @@ -462,7 +462,7 @@ isp_sbus_mbxdma(struct ispsoftc *isp) n = sizeof (bus_dmamap_t) * isp->isp_maxcmds; sbc->sbus_dmamap = (bus_dmamap_t *) malloc(n, M_DEVBUF, M_WAITOK); if (sbc->sbus_dmamap == NULL) { - free(isp->isp_xflist, M_DEVBUF); + free(isp->isp_xflist, M_DEVBUF, 0); isp->isp_xflist = NULL; isp_prt(isp, ISP_LOGERR, "cannot alloc dmamap array"); return (1); @@ -480,8 +480,8 @@ isp_sbus_mbxdma(struct ispsoftc *isp) bus_dmamap_destroy(isp->isp_dmatag, sbc->sbus_dmamap[i]); } - free(isp->isp_xflist, M_DEVBUF); - free(sbc->sbus_dmamap, M_DEVBUF); + free(isp->isp_xflist, M_DEVBUF, 0); + free(sbc->sbus_dmamap, M_DEVBUF, 0); isp->isp_xflist = NULL; sbc->sbus_dmamap = NULL; return (1); @@ -555,8 +555,8 @@ dmafail: for (i = 0; i < isp->isp_maxcmds; i++) { bus_dmamap_destroy(isp->isp_dmatag, sbc->sbus_dmamap[i]); } - free(sbc->sbus_dmamap, M_DEVBUF); - free(isp->isp_xflist, M_DEVBUF); + free(sbc->sbus_dmamap, M_DEVBUF, 0); + free(isp->isp_xflist, M_DEVBUF, 0); isp->isp_xflist = NULL; sbc->sbus_dmamap = NULL; return (1); diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 063a10f7a95..41de56dfee2 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.23 2010/07/02 17:27:01 nicm Exp $ */ +/* $OpenBSD: magma.c,v 1.24 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -1627,7 +1627,7 @@ mbpp_rw(dev_t dev, struct uio *uio) uio->uio_resid += (len - cnt); } - free(buffer, M_DEVBUF); + free(buffer, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/sbus/qla_sbus.c b/sys/dev/sbus/qla_sbus.c index 4f2904de902..c36382f5c95 100644 --- a/sys/dev/sbus/qla_sbus.c +++ b/sys/dev/sbus/qla_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla_sbus.c,v 1.1 2014/02/02 13:01:58 kettenis Exp $ */ +/* $OpenBSD: qla_sbus.c,v 1.2 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2014 Mark Kettenis * @@ -152,5 +152,5 @@ qla_sbus_attach(struct device *parent, struct device *self, void *aux) unmap: bus_space_unmap(iot, ioh, sa->sa_size); free: - free(iot, M_DEVBUF); + free(iot, M_DEVBUF, 0); } diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c index 25af0462d7e..d3c79248ef5 100644 --- a/sys/dev/sdmmc/sdhc.c +++ b/sys/dev/sdmmc/sdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdhc.c,v 1.37 2013/12/06 21:03:04 deraadt Exp $ */ +/* $OpenBSD: sdhc.c,v 1.38 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -242,7 +242,7 @@ sdhc_host_found(struct sdhc_softc *sc, bus_space_tag_t iot, return 0; err: - free(hp, M_DEVBUF); + free(hp, M_DEVBUF, 0); sc->sc_host[sc->sc_nhosts - 1] = NULL; sc->sc_nhosts--; return (error); diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c index fa962a717c9..ec14e473002 100644 --- a/sys/dev/sdmmc/sdmmc.c +++ b/sys/dev/sdmmc/sdmmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc.c,v 1.33 2014/03/05 21:35:21 sthen Exp $ */ +/* $OpenBSD: sdmmc.c,v 1.34 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -487,7 +487,7 @@ sdmmc_function_alloc(struct sdmmc_softc *sc) void sdmmc_function_free(struct sdmmc_function *sf) { - free(sf, M_DEVBUF); + free(sf, M_DEVBUF, 0); } /* @@ -810,7 +810,7 @@ sdmmc_ioctl(struct device *self, u_long request, caddr_t addr) return EFAULT; if (ucmd->c_data) - free(data, M_TEMP); + free(data, M_TEMP, 0); break; default: diff --git a/sys/dev/sdmmc/sdmmc_io.c b/sys/dev/sdmmc/sdmmc_io.c index b7137efb08e..4f8244d5fd3 100644 --- a/sys/dev/sdmmc/sdmmc_io.c +++ b/sys/dev/sdmmc/sdmmc_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_io.c,v 1.19 2010/08/24 14:52:23 blambert Exp $ */ +/* $OpenBSD: sdmmc_io.c,v 1.20 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -682,7 +682,7 @@ sdmmc_intr_disestablish(void *cookie) } splx(s); - free(ih, M_DEVBUF); + free(ih, M_DEVBUF, 0); } /* diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c index f06f5ac2d15..3d4d9d25c6a 100644 --- a/sys/dev/sdmmc/sdmmc_mem.c +++ b/sys/dev/sdmmc/sdmmc_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_mem.c,v 1.18 2013/10/22 16:49:27 syl Exp $ */ +/* $OpenBSD: sdmmc_mem.c,v 1.19 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -370,7 +370,7 @@ sdmmc_mem_send_cxd_data(struct sdmmc_softc *sc, int opcode, void *data, out: if (ptr != NULL) - free(ptr, M_DEVBUF); + free(ptr, M_DEVBUF, 0); return error; } diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c index b27f5d45086..1332a7f3d79 100644 --- a/sys/dev/sdmmc/sdmmc_scsi.c +++ b/sys/dev/sdmmc/sdmmc_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_scsi.c,v 1.30 2011/07/17 22:46:48 matthew Exp $ */ +/* $OpenBSD: sdmmc_scsi.c,v 1.31 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -152,8 +152,8 @@ sdmmc_scsi_attach(struct sdmmc_softc *sc) sc->sc_scsibus = NULL; sdmmc_free_ccbs(scbus); free_sctgt: - free(scbus->sc_tgt, M_DEVBUF); - free(scbus, M_DEVBUF); + free(scbus->sc_tgt, M_DEVBUF, 0); + free(scbus, M_DEVBUF, 0); } void @@ -180,10 +180,10 @@ sdmmc_scsi_detach(struct sdmmc_softc *sc) config_detach(scbus->sc_child, DETACH_FORCE); if (scbus->sc_tgt != NULL) - free(scbus->sc_tgt, M_DEVBUF); + free(scbus->sc_tgt, M_DEVBUF, 0); sdmmc_free_ccbs(scbus); - free(scbus, M_DEVBUF); + free(scbus, M_DEVBUF, 0); sc->sc_scsibus = NULL; } @@ -224,7 +224,7 @@ void sdmmc_free_ccbs(struct sdmmc_scsi_softc *scbus) { if (scbus->sc_ccbs != NULL) { - free(scbus->sc_ccbs, M_DEVBUF); + free(scbus->sc_ccbs, M_DEVBUF, 0); scbus->sc_ccbs = NULL; } } diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index a6ffba7f70d..042c3e7b208 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.333 2014/07/12 07:39:11 blambert Exp $ */ +/* $OpenBSD: softraid.c,v 1.334 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom * Copyright (c) 2008 Chris Kuethe @@ -523,7 +523,7 @@ sr_meta_clear(struct sr_discipline *sd) bzero(sd->sd_meta, SR_META_SIZE * 512); - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); rv = 0; done: return (rv); @@ -726,7 +726,7 @@ restart: wu.swu_dis = sd; sd->sd_scsi_sync(&wu); } - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return (0); bad: return (1); @@ -797,9 +797,9 @@ sr_meta_read(struct sr_discipline *sd) cp++; } - free(sm, M_DEVBUF); + free(sm, M_DEVBUF, 0); if (fm) - free(fm, M_DEVBUF); + free(fm, M_DEVBUF, 0); done: DNPRINTF(SR_D_META, "%s: sr_meta_read found %d parts\n", DEVNAME(sc), @@ -1129,9 +1129,9 @@ sr_meta_native_bootprobe(struct sr_softc *sc, dev_t devno, done: if (fake_sd) - free(fake_sd, M_DEVBUF); + free(fake_sd, M_DEVBUF, 0); if (md) - free(md, M_DEVBUF); + free(md, M_DEVBUF, 0); return (rv); } @@ -1467,36 +1467,36 @@ unwind: bc1 != SLIST_END(&bv1->sbv_chunks); bc1 = bc2) { bc2 = SLIST_NEXT(bc1, sbc_link); if (bc1->sbc_metadata) - free(bc1->sbc_metadata, M_DEVBUF); - free(bc1, M_DEVBUF); + free(bc1->sbc_metadata, M_DEVBUF, 0); + free(bc1, M_DEVBUF, 0); } - free(bv1, M_DEVBUF); + free(bv1, M_DEVBUF, 0); } /* Free keydisks chunks. */ for (bc1 = SLIST_FIRST(&kdh); bc1 != SLIST_END(&kdh); bc1 = bc2) { bc2 = SLIST_NEXT(bc1, sbc_link); if (bc1->sbc_metadata) - free(bc1->sbc_metadata, M_DEVBUF); - free(bc1, M_DEVBUF); + free(bc1->sbc_metadata, M_DEVBUF, 0); + free(bc1, M_DEVBUF, 0); } /* Free unallocated chunks. */ for (bc1 = SLIST_FIRST(&bch); bc1 != SLIST_END(&bch); bc1 = bc2) { bc2 = SLIST_NEXT(bc1, sbc_link); if (bc1->sbc_metadata) - free(bc1->sbc_metadata, M_DEVBUF); - free(bc1, M_DEVBUF); + free(bc1->sbc_metadata, M_DEVBUF, 0); + free(bc1, M_DEVBUF, 0); } while (!SLIST_EMPTY(&sdklist)) { sdk = SLIST_FIRST(&sdklist); SLIST_REMOVE_HEAD(&sdklist, sdk_link); - free(sdk, M_DEVBUF); + free(sdk, M_DEVBUF, 0); } if (devs) - free(devs, M_DEVBUF); + free(devs, M_DEVBUF, 0); if (ondisk) - free(ondisk, M_DEVBUF); + free(ondisk, M_DEVBUF, 0); return (rv); } @@ -1693,7 +1693,7 @@ sr_meta_native_attach(struct sr_discipline *sd, int force) rv = 0; bad: if (md) - free(md, M_DEVBUF); + free(md, M_DEVBUF, 0); return (rv); } @@ -1758,7 +1758,7 @@ sr_hotplug_unregister(struct sr_discipline *sd, void *func) if (mhe->sh_hotplug == func) { SLIST_REMOVE(&sr_hotplug_callbacks, mhe, sr_hotplug_list, shl_link); - free(mhe, M_DEVBUF); + free(mhe, M_DEVBUF, 0); if (SLIST_EMPTY(&sr_hotplug_callbacks)) SLIST_INIT(&sr_hotplug_callbacks); return; @@ -1963,7 +1963,7 @@ sr_ccb_free(struct sr_discipline *sd) TAILQ_REMOVE(&sd->sd_ccb_freeq, ccb, ccb_link); if (sd->sd_ccb) - free(sd->sd_ccb, M_DEVBUF); + free(sd->sd_ccb, M_DEVBUF, 0); } struct sr_ccb * @@ -2142,7 +2142,7 @@ sr_wu_free(struct sr_discipline *sd) while ((wu = TAILQ_FIRST(&sd->sd_wu)) != NULL) { TAILQ_REMOVE(&sd->sd_wu, wu, swu_next); - free(wu, M_DEVBUF); + free(wu, M_DEVBUF, 0); } } @@ -2962,15 +2962,15 @@ sr_hotspare(struct sr_softc *sc, dev_t dev) fail: if (hotspare) - free(hotspare, M_DEVBUF); + free(hotspare, M_DEVBUF, 0); done: if (sd && sd->sd_vol.sv_chunks) - free(sd->sd_vol.sv_chunks, M_DEVBUF); + free(sd->sd_vol.sv_chunks, M_DEVBUF, 0); if (sd) - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); if (sm) - free(sm, M_DEVBUF); + free(sm, M_DEVBUF, 0); if (open) { VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc); vput(vn); @@ -3076,7 +3076,7 @@ sr_hotspare_rebuild(struct sr_discipline *sd) /* Remove hotspare from available list. */ sc->sc_hotspare_no--; SLIST_REMOVE(cl, hotspare, sr_chunk, src_link); - free(hotspare, M_DEVBUF); + free(hotspare, M_DEVBUF, 0); } rw_exit_write(&sc->sc_lock); @@ -3342,7 +3342,7 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, &sd->sd_meta->ssdi.ssd_uuid); sr_error(sc, "disk %s is currently in use; " "cannot force create", uuid); - free(uuid, M_DEVBUF); + free(uuid, M_DEVBUF, 0); goto unwind; } @@ -3399,7 +3399,7 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, if (sr_already_assembled(sd)) { uuid = sr_uuid_format(&sd->sd_meta->ssdi.ssd_uuid); sr_error(sc, "disk %s already assembled", uuid); - free(uuid, M_DEVBUF); + free(uuid, M_DEVBUF, 0); goto unwind; } @@ -3758,9 +3758,9 @@ sr_ioctl_installboot(struct sr_softc *sc, struct bioc_installboot *bb) done: if (bootblk) - free(bootblk, M_DEVBUF); + free(bootblk, M_DEVBUF, 0); if (bootldr) - free(bootldr, M_DEVBUF); + free(bootldr, M_DEVBUF, 0); return (rv); } @@ -3793,7 +3793,7 @@ sr_chunks_unwind(struct sr_softc *sc, struct sr_chunk_head *cl) curproc); vput(ch_entry->src_vn); } - free(ch_entry, M_DEVBUF); + free(ch_entry, M_DEVBUF, 0); } SLIST_INIT(cl); } @@ -3817,18 +3817,18 @@ sr_discipline_free(struct sr_discipline *sd) if (sd->sd_free_resources) sd->sd_free_resources(sd); if (sd->sd_vol.sv_chunks) - free(sd->sd_vol.sv_chunks, M_DEVBUF); + free(sd->sd_vol.sv_chunks, M_DEVBUF, 0); if (sd->sd_meta) - free(sd->sd_meta, M_DEVBUF); + free(sd->sd_meta, M_DEVBUF, 0); if (sd->sd_meta_foreign) - free(sd->sd_meta_foreign, M_DEVBUF); + free(sd->sd_meta_foreign, M_DEVBUF, 0); som = &sd->sd_meta_opt; for (omi = SLIST_FIRST(som); omi != SLIST_END(som); omi = omi_next) { omi_next = SLIST_NEXT(omi, omi_link); if (omi->omi_som) - free(omi->omi_som, M_DEVBUF); - free(omi, M_DEVBUF); + free(omi->omi_som, M_DEVBUF, 0); + free(omi, M_DEVBUF, 0); } if (sd->sd_target != 0) { @@ -3844,7 +3844,7 @@ sr_discipline_free(struct sr_discipline *sd) } explicit_bzero(sd, sizeof *sd); - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); } void @@ -4458,7 +4458,7 @@ sr_uuid_print(struct sr_uuid *uuid, int cr) uuidstr = sr_uuid_format(uuid); printf("%s%s", uuidstr, (cr ? "\n" : "")); - free(uuidstr, M_DEVBUF); + free(uuidstr, M_DEVBUF, 0); } int diff --git a/sys/dev/softraid_aoe.c b/sys/dev/softraid_aoe.c index 95a7cb805b2..423d6edf147 100644 --- a/sys/dev/softraid_aoe.c +++ b/sys/dev/softraid_aoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_aoe.c,v 1.36 2014/01/21 04:23:14 jsing Exp $ */ +/* $OpenBSD: softraid_aoe.c,v 1.37 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2008 Ted Unangst * Copyright (c) 2008 Marco Peereboom @@ -215,7 +215,7 @@ sr_aoe_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, s = splnet(); TAILQ_REMOVE(&aoe_handlers, ah, next); splx(s); - free(ah, M_DEVBUF); + free(ah, M_DEVBUF, 0); return rv; } #endif @@ -268,11 +268,11 @@ sr_aoe_free_resources(struct sr_discipline *sd) s = splnet(); TAILQ_REMOVE(&aoe_handlers, ah, next); splx(s); - free(ah, M_DEVBUF); + free(ah, M_DEVBUF, 0); } if (sd->sd_meta) - free(sd->sd_meta, M_DEVBUF); + free(sd->sd_meta, M_DEVBUF, 0); sr_wu_free(sd); sr_ccb_free(sd); @@ -328,7 +328,7 @@ sr_send_aoe_chunk(struct sr_workunit *wu, daddr_t blk, int i) s = splbio(); TAILQ_REMOVE(&ah->reqs, ar, next); splx(s); - free(ar, M_DEVBUF); + free(ar, M_DEVBUF, 0); return ENOMEM; } @@ -370,7 +370,7 @@ sr_send_aoe_chunk(struct sr_workunit *wu, daddr_t blk, int i) s = splbio(); TAILQ_REMOVE(&ah->reqs, ar, next); splx(s); - free(ar, M_DEVBUF); + free(ar, M_DEVBUF, 0); } return rv; @@ -498,7 +498,7 @@ sr_aoe_request_done(struct aoe_req *ar, struct aoe_packet *ap) } splx(s); - free(ar, M_DEVBUF); + free(ar, M_DEVBUF, 0); } void @@ -650,7 +650,7 @@ sr_aoe_server_free_resources(struct sr_discipline *sd) s = splnet(); if (sd->mds.mdd_aoe.sra_ah) { TAILQ_REMOVE(&aoe_handlers, sd->mds.mdd_aoe.sra_ah, next); - free(sd->mds.mdd_aoe.sra_ah, M_DEVBUF); + free(sd->mds.mdd_aoe.sra_ah, M_DEVBUF, 0); } splx(s); diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c index d33390cac72..3d7a6368bdf 100644 --- a/sys/dev/softraid_crypto.c +++ b/sys/dev/softraid_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_crypto.c,v 1.109 2014/01/22 01:46:08 jsing Exp $ */ +/* $OpenBSD: softraid_crypto.c,v 1.110 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2007 Marco Peereboom * Copyright (c) 2008 Hans-Joerg Hoexer @@ -357,7 +357,7 @@ sr_crypto_get_kdf(struct bioc_createraid *bc, struct sr_discipline *sd) rv = 0; out: explicit_bzero(kdfinfo, bc->bc_opaque_size); - free(kdfinfo, M_DEVBUF); + free(kdfinfo, M_DEVBUF, 0); return (rv); } @@ -591,7 +591,7 @@ sr_crypto_change_maskkey(struct sr_discipline *sd, out: if (p) { explicit_bzero(p, ksz); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } explicit_bzero(check_digest, sizeof(check_digest)); @@ -753,18 +753,18 @@ sr_crypto_create_key_disk(struct sr_discipline *sd, dev_t dev) fail: if (key_disk) - free(key_disk, M_DEVBUF); + free(key_disk, M_DEVBUF, 0); key_disk = NULL; done: if (omi) - free(omi, M_DEVBUF); + free(omi, M_DEVBUF, 0); if (fakesd && fakesd->sd_vol.sv_chunks) - free(fakesd->sd_vol.sv_chunks, M_DEVBUF); + free(fakesd->sd_vol.sv_chunks, M_DEVBUF, 0); if (fakesd) - free(fakesd, M_DEVBUF); + free(fakesd, M_DEVBUF, 0); if (sm) - free(sm, M_DEVBUF); + free(sm, M_DEVBUF, 0); if (open) { VOP_CLOSE(vn, FREAD | FWRITE, NOCRED, curproc); vput(vn); @@ -890,12 +890,12 @@ done: for (omi = SLIST_FIRST(&som); omi != SLIST_END(&som); omi = omi_next) { omi_next = SLIST_NEXT(omi, omi_link); if (omi->omi_som) - free(omi->omi_som, M_DEVBUF); - free(omi, M_DEVBUF); + free(omi->omi_som, M_DEVBUF, 0); + free(omi, M_DEVBUF, 0); } if (sm) - free(sm, M_DEVBUF); + free(sm, M_DEVBUF, 0); if (vn && open) { VOP_CLOSE(vn, FREAD, NOCRED, curproc); @@ -1002,7 +1002,7 @@ sr_crypto_free_resources(struct sr_discipline *sd) if (sd->mds.mdd_crypto.key_disk != NULL) { explicit_bzero(sd->mds.mdd_crypto.key_disk, sizeof sd->mds.mdd_crypto.key_disk); - free(sd->mds.mdd_crypto.key_disk, M_DEVBUF); + free(sd->mds.mdd_crypto.key_disk, M_DEVBUF, 0); } sr_hotplug_unregister(sd, sr_crypto_hotplug); diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c index ba84873e757..b188164b015 100644 --- a/sys/dev/softraid_raid6.c +++ b/sys/dev/softraid_raid6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid6.c,v 1.61 2014/01/22 05:11:36 jsing Exp $ */ +/* $OpenBSD: softraid_raid6.c,v 1.62 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2009 Marco Peereboom * Copyright (c) 2009 Jordan Hargrave @@ -684,7 +684,7 @@ sr_raid6_intr(struct buf *bp) /* Calculate q-parity */ sr_raid6_xorq(pq->qbuf, ccb->ccb_buf.b_data, ccb->ccb_buf.b_bcount, pq->gn); - free(pq, M_DEVBUF); + free(pq, M_DEVBUF, 0); ccb->ccb_opaque = NULL; } diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c index ab9c0e6e0ae..67f83d9fc26 100644 --- a/sys/dev/systrace.c +++ b/sys/dev/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.69 2014/06/17 03:49:03 guenther Exp $ */ +/* $OpenBSD: systrace.c,v 1.70 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. @@ -458,7 +458,7 @@ systracef_close(struct file *fp, struct proc *p) vrele(fst->fd_rdir); rw_exit_write(&fst->lock); - free(fp->f_data, M_XDATA); + free(fp->f_data, M_XDATA, 0); fp->f_data = NULL; return (0); @@ -511,7 +511,7 @@ systraceioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) error = falloc(p, &f, &fd); fdpunlock(p->p_fd); if (error) { - free(fst, M_XDATA); + free(fst, M_XDATA, 0); return (error); } f->f_flag = FREAD | FWRITE; @@ -929,7 +929,7 @@ systrace_inject(struct str_process *strp, int docopy) if (!ret && docopy && copyout(inject->kaddr, inject->uaddr, inject->len)) ret = EINVAL; - free(inject->kaddr, M_XDATA); + free(inject->kaddr, M_XDATA, 0); } strp->injectind = 0; @@ -958,7 +958,7 @@ systrace_prepinject(struct str_process *strp, struct systrace_inject *inj) kaddr = malloc(inj->stri_len, M_XDATA, M_WAITOK); ret = copyin(inj->stri_addr, kaddr, inj->stri_len); if (ret) { - free(kaddr, M_XDATA); + free(kaddr, M_XDATA, 0); return (ret); } @@ -1322,7 +1322,7 @@ systrace_preprepl(struct str_process *strp, struct systrace_replace *repl) return (ret); if (strp->replace != NULL) { - free(strp->replace, M_XDATA); + free(strp->replace, M_XDATA, 0); strp->replace = NULL; } @@ -1358,7 +1358,7 @@ systrace_preprepl(struct str_process *strp, struct systrace_replace *repl) memcpy(strp->replace, repl, sizeof(struct systrace_replace)); ret = copyin(repl->strr_base, strp->replace + 1, len); if (ret) { - free(strp->replace, M_XDATA); + free(strp->replace, M_XDATA, 0); strp->replace = NULL; return (ret); } @@ -1437,7 +1437,7 @@ void systrace_replacefree(struct str_process *strp) { if (strp->replace != NULL) { - free(strp->replace, M_XDATA); + free(strp->replace, M_XDATA, 0); strp->replace = NULL; } while (strp->nfname > 0) { @@ -1585,7 +1585,7 @@ systrace_closepolicy(struct fsystrace *fst, struct str_policy *policy) fst->npolicies--; if (policy->nsysent) - free(policy->sysent, M_XDATA); + free(policy->sysent, M_XDATA, 0); TAILQ_REMOVE(&fst->policies, policy, next); diff --git a/sys/dev/tc/bba.c b/sys/dev/tc/bba.c index 2b234462cd9..e1d0373c8cf 100644 --- a/sys/dev/tc/bba.c +++ b/sys/dev/tc/bba.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bba.c,v 1.3 2013/05/15 08:29:26 ratchov Exp $ */ +/* $OpenBSD: bba.c,v 1.4 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: bba.c,v 1.38 2011/06/04 01:27:57 tsutsui Exp $ */ /* * Copyright (c) 2011 Miodrag Vallat. @@ -358,7 +358,7 @@ bba_freem(void *v, void *ptr, int mtype) seg.ds_addr = m->addr; seg.ds_len = m->size; bus_dmamem_free(sc->sc_dmat, &seg, 1); - free(m, mtype); + free(m, mtype, 0); } size_t diff --git a/sys/dev/usb/ezload.c b/sys/dev/usb/ezload.c index 84ee1efa03f..ec30279fed8 100644 --- a/sys/dev/usb/ezload.c +++ b/sys/dev/usb/ezload.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ezload.c,v 1.12 2013/04/15 09:23:01 mglocker Exp $ */ +/* $OpenBSD: ezload.c,v 1.13 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ezload.c,v 1.5 2002/07/11 21:14:25 augustss Exp $ */ /* @@ -164,7 +164,7 @@ ezload_downloads_and_reset(struct usbd_device *dev, char **names) return (error); err = ezload_download(dev, *names, buf, buflen); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); if (err) return (err); names++; diff --git a/sys/dev/usb/hid.c b/sys/dev/usb/hid.c index 12c6111a22a..bae5cb23720 100644 --- a/sys/dev/usb/hid.c +++ b/sys/dev/usb/hid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hid.c,v 1.27 2014/05/18 21:43:11 jca Exp $ */ +/* $OpenBSD: hid.c,v 1.28 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: hid.c,v 1.23 2002/07/11 21:14:25 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/hid.c,v 1.11 1999/11/17 22:33:39 n_hibma Exp $ */ @@ -160,7 +160,7 @@ hid_end_parse(struct hid_data *s) if (s == NULL) return; - free(s, M_TEMP); + free(s, M_TEMP, 0); } static uint8_t diff --git a/sys/dev/usb/hidkbd.c b/sys/dev/usb/hidkbd.c index d060bbbbfa4..a8fd748e803 100644 --- a/sys/dev/usb/hidkbd.c +++ b/sys/dev/usb/hidkbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hidkbd.c,v 1.12 2014/05/12 09:50:44 mpi Exp $ */ +/* $OpenBSD: hidkbd.c,v 1.13 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -249,7 +249,7 @@ hidkbd_detach(struct hidkbd *kbd, int flags) rv = config_detach(kbd->sc_wskbddev, flags); if (kbd->sc_var != NULL) - free(kbd->sc_var, M_DEVBUF); + free(kbd->sc_var, M_DEVBUF, 0); return (rv); } diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 67f1dd12fe9..26cd14ce98b 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.20 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.21 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini @@ -447,7 +447,7 @@ athn_usb_close_pipes(struct athn_usb_softc *usc) usbd_close_pipe(usc->rx_intr_pipe); } if (usc->ibuf != NULL) - free(usc->ibuf, M_USBDEV); + free(usc->ibuf, M_USBDEV, 0); } int @@ -664,14 +664,14 @@ athn_usb_load_firmware(struct athn_usb_softc *usc) USETW(req.wLength, mlen); error = usbd_do_request(usc->sc_udev, &req, ptr); if (error != 0) { - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return (error); } addr += mlen >> 8; ptr += mlen; size -= mlen; } - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); /* Start firmware. */ if (usc->flags & ATHN_USB_FLAG_AR7010) diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index dad17a87a72..66c9491406a 100644 --- a/sys/dev/usb/if_atu.c +++ b/sys/dev/usb/if_atu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atu.c,v 1.107 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_atu.c,v 1.108 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2003, 2004 * Daan Vreeken . All rights reserved. @@ -908,7 +908,7 @@ atu_internal_firmware(void *arg) if (err) { DPRINTF(("%s: dfu_getstatus failed!\n", sc->atu_dev.dv_xname)); - free(firm, M_DEVBUF); + free(firm, M_DEVBUF, 0); goto fail; } /* success means state => DnLoadIdle */ @@ -930,7 +930,7 @@ atu_internal_firmware(void *arg) if (err) { DPRINTF(("%s: dfu_dnload failed\n", sc->atu_dev.dv_xname)); - free(firm, M_DEVBUF); + free(firm, M_DEVBUF, 0); goto fail; } @@ -949,7 +949,7 @@ atu_internal_firmware(void *arg) state = atu_get_dfu_state(sc); } - free(firm, M_DEVBUF); + free(firm, M_DEVBUF, 0); if (state != DFUState_ManifestSync) { DPRINTF(("%s: state != manifestsync... eek!\n", @@ -1021,7 +1021,7 @@ atu_external_firmware(void *arg) if (err) { DPRINTF(("%s: could not load external firmware " "block\n", sc->atu_dev.dv_xname)); - free(firm, M_DEVBUF); + free(firm, M_DEVBUF, 0); return; } @@ -1029,7 +1029,7 @@ atu_external_firmware(void *arg) block++; bytes_left -= block_size; } - free(firm, M_DEVBUF); + free(firm, M_DEVBUF, 0); err = atu_usb_request(sc, UT_WRITE_VENDOR_DEVICE, 0x0e, 0x0802, block, 0, NULL); diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 635f14959b3..b902d61de3d 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.72 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_kue.c,v 1.73 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -275,7 +275,7 @@ kue_load_fw(struct kue_softc *sc) if (err) { printf("%s: failed to load code segment: %s\n", sc->kue_dev.dv_xname, usbd_errstr(err)); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (EIO); } @@ -287,7 +287,7 @@ kue_load_fw(struct kue_softc *sc) if (err) { printf("%s: failed to load fixup segment: %s\n", sc->kue_dev.dv_xname, usbd_errstr(err)); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (EIO); } @@ -300,10 +300,10 @@ kue_load_fw(struct kue_softc *sc) if (err) { printf("%s: failed to load trigger segment: %s\n", sc->kue_dev.dv_xname, usbd_errstr(err)); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (EIO); } - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); usbd_delay_ms(sc->kue_udev, 10); @@ -551,7 +551,7 @@ kue_detach(struct device *self, int flags) s = splusb(); /* XXX why? */ if (sc->kue_mcfilters != NULL) { - free(sc->kue_mcfilters, M_USBDEV); + free(sc->kue_mcfilters, M_USBDEV, 0); sc->kue_mcfilters = NULL; } diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 44788fe9bf0..5d6cf8e1fd1 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.40 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_otus.c,v 1.41 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -459,7 +459,7 @@ otus_load_firmware(struct otus_softc *sc, const char *name, uint32_t addr) ptr += mlen; size -= mlen; } - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return error; } @@ -571,7 +571,7 @@ otus_close_pipes(struct otus_softc *sc) usbd_close_pipe(sc->cmd_rx_pipe); } if (sc->ibuf != NULL) - free(sc->ibuf, M_USBDEV); + free(sc->ibuf, M_USBDEV, 0); if (sc->data_tx_pipe != NULL) usbd_close_pipe(sc->data_tx_pipe); if (sc->cmd_tx_pipe != NULL) diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index d5f5c30ea6e..54bf9f537f4 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.20 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.21 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -2171,7 +2171,7 @@ rsu_load_firmware(struct rsu_softc *sc) goto fail; } fail: - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 53dfb0bda9c..549d3d4c04a 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.104 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_rum.c,v 1.105 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini @@ -259,7 +259,7 @@ rum_attachhook(void *xsc) sc->sc_dev.dv_xname); } - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); } void diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 7d4f81496f0..dcefd38cd69 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.101 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_run.c,v 1.102 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini @@ -860,14 +860,14 @@ run_load_microcode(struct run_softc *sc) if (size != 4096) { printf("%s: invalid firmware size (should be 4KB)\n", sc->sc_dev.dv_xname); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return EINVAL; } run_read(sc, RT2860_ASIC_VER_ID, &tmp); /* write microcode image */ run_write_region_1(sc, RT2870_FW_BASE, ucode, size); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); run_write(sc, RT2860_H2M_MAILBOX_CID, 0xffffffff); run_write(sc, RT2860_H2M_MAILBOX_STATUS, 0xffffffff); diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index fd8c22e7925..b3a5547bd5c 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.59 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_uath.c,v 1.60 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2006 @@ -217,7 +217,7 @@ uath_attachhook(void *xsc) } error = uath_loadfirmware(sc, fw, size); - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); if (error == 0) { usb_port_status_t status; diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index e418924b412..8da85504011 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.62 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.63 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -628,7 +628,7 @@ void upgt_fw_free(struct upgt_softc *sc) { if (sc->sc_fw != NULL) { - free(sc->sc_fw, M_DEVBUF); + free(sc->sc_fw, M_DEVBUF, 0); sc->sc_fw = NULL; DPRINTF(1, "%s: firmware freed\n", sc->sc_dev.dv_xname); } diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 9cc6d7e1017..d142364aa44 100644 --- a/sys/dev/usb/if_urndis.c +++ b/sys/dev/usb/if_urndis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urndis.c,v 1.47 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_urndis.c,v 1.48 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2010 Jonathan Armani @@ -186,7 +186,7 @@ urndis_ctrl_recv(struct urndis_softc *sc) if (err != USBD_NORMAL_COMPLETION && err != USBD_SHORT_XFER) { printf("%s: %s\n", DEVNAME(sc), usbd_errstr(err)); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return NULL; } @@ -201,7 +201,7 @@ urndis_ctrl_recv(struct urndis_softc *sc) DEVNAME(sc), letoh32(hdr->rm_len), RNDIS_RESPONSE_LEN); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return NULL; } @@ -245,7 +245,7 @@ urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, rval = RNDIS_STATUS_FAILURE; } - free(hdr, M_TEMP); + free(hdr, M_TEMP, 0); return rval; } @@ -436,7 +436,7 @@ urndis_ctrl_init(struct urndis_softc *sc) letoh32(msg->rm_max_xfersz))); rval = urndis_ctrl_send(sc, msg, sizeof(*msg)); - free(msg, M_TEMP); + free(msg, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) { printf("%s: init failed\n", DEVNAME(sc)); @@ -475,7 +475,7 @@ urndis_ctrl_halt(struct urndis_softc *sc) letoh32(msg->rm_rid))); rval = urndis_ctrl_send(sc, msg, sizeof(*msg)); - free(msg, M_TEMP); + free(msg, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) printf("%s: halt failed\n", DEVNAME(sc)); @@ -522,7 +522,7 @@ urndis_ctrl_query(struct urndis_softc *sc, u_int32_t oid, letoh32(msg->rm_devicevchdl))); rval = urndis_ctrl_send(sc, msg, sizeof(*msg)); - free(msg, M_TEMP); + free(msg, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) { printf("%s: query failed\n", DEVNAME(sc)); @@ -575,7 +575,7 @@ urndis_ctrl_set(struct urndis_softc *sc, u_int32_t oid, void *buf, size_t len) letoh32(msg->rm_devicevchdl))); rval = urndis_ctrl_send(sc, msg, sizeof(*msg)); - free(msg, M_TEMP); + free(msg, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) { printf("%s: set failed\n", DEVNAME(sc)); @@ -639,7 +639,7 @@ urndis_ctrl_set_param(struct urndis_softc *sc, letoh32(param->rm_valuelen))); rval = urndis_ctrl_set(sc, OID_GEN_RNDIS_CONFIG_PARAMETER, param, tlen); - free(param, M_TEMP); + free(param, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) printf("%s: set param failed 0x%x\n", DEVNAME(sc), rval); @@ -672,7 +672,7 @@ urndis_ctrl_reset(struct urndis_softc *sc) letoh32(reset->rm_rid))); rval = urndis_ctrl_send(sc, reset, sizeof(*reset)); - free(reset, M_TEMP); + free(reset, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) { printf("%s: reset failed\n", DEVNAME(sc)); @@ -712,7 +712,7 @@ urndis_ctrl_keepalive(struct urndis_softc *sc) letoh32(keep->rm_rid))); rval = urndis_ctrl_send(sc, keep, sizeof(*keep)); - free(keep, M_TEMP); + free(keep, M_TEMP, 0); if (rval != RNDIS_STATUS_SUCCESS) { printf("%s: keepalive failed\n", DEVNAME(sc)); @@ -1446,10 +1446,10 @@ urndis_attach(struct device *parent, struct device *self, void *aux) if (bufsz == ETHER_ADDR_LEN) { memcpy(eaddr, buf, ETHER_ADDR_LEN); printf(", address %s\n", ether_sprintf(eaddr)); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); } else { printf(", invalid address\n"); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); splx(s); return; } diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index a3c4c28ead0..a0c73240186 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.36 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.37 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -2277,7 +2277,7 @@ urtwn_load_firmware(struct urtwn_softc *sc) goto fail; } fail: - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c index e1460c6be16..255879a5517 100644 --- a/sys/dev/usb/if_wi_usb.c +++ b/sys/dev/usb/if_wi_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_usb.c,v 1.61 2014/07/12 07:59:23 mpi Exp $ */ +/* $OpenBSD: if_wi_usb.c,v 1.62 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2003 Dale Rahn. All rights reserved. @@ -432,7 +432,7 @@ wi_usb_detach(struct device *self, int flags) while (sc->wi_usb_nummem) { sc->wi_usb_nummem--; if (sc->wi_usb_txmem[sc->wi_usb_nummem] != NULL) - free(sc->wi_usb_txmem[sc->wi_usb_nummem], M_DEVBUF); + free(sc->wi_usb_txmem[sc->wi_usb_nummem], M_DEVBUF, 0); sc->wi_usb_txmem[sc->wi_usb_nummem] = NULL; } @@ -563,7 +563,7 @@ wi_cmd_usb(struct wi_softc *wsc, int cmd, int val0, int val1, int val2) /* free alloc_nicmem regions */ while (sc->wi_usb_nummem) { sc->wi_usb_nummem--; - free(sc->wi_usb_txmem[sc->wi_usb_nummem], M_DEVBUF); + free(sc->wi_usb_txmem[sc->wi_usb_nummem], M_DEVBUF, 0); sc->wi_usb_txmem[sc->wi_usb_nummem] = NULL; } diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c index e2245dc5f42..f2a00065096 100644 --- a/sys/dev/usb/if_zyd.c +++ b/sys/dev/usb/if_zyd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_zyd.c,v 1.102 2014/07/12 15:26:54 stsp Exp $ */ +/* $OpenBSD: if_zyd.c,v 1.103 2014/07/12 18:48:52 tedu Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini @@ -270,7 +270,7 @@ zyd_attachhook(void *xsc) } error = zyd_loadfirmware(sc, fw, size); - free(fw, M_DEVBUF); + free(fw, M_DEVBUF, 0); if (error != 0) { printf("%s: could not load firmware (error=%d)\n", sc->sc_dev.dv_xname, error); @@ -534,7 +534,7 @@ zyd_close_pipes(struct zyd_softc *sc) } } if (sc->ibuf != NULL) { - free(sc->ibuf, M_USBDEV); + free(sc->ibuf, M_USBDEV, 0); sc->ibuf = NULL; } } diff --git a/sys/dev/usb/uaudio.c b/sys/dev/usb/uaudio.c index cc2a43e9aa5..23ba515feb8 100644 --- a/sys/dev/usb/uaudio.c +++ b/sys/dev/usb/uaudio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uaudio.c,v 1.103 2014/06/04 08:01:25 ratchov Exp $ */ +/* $OpenBSD: uaudio.c,v 1.104 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uaudio.c,v 1.90 2004/10/29 17:12:53 kent Exp $ */ /* @@ -682,7 +682,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc *sc, struct mixerctl *mc) /* Copy old data, if there was any */ if (sc->sc_nctls != 0) { bcopy(sc->sc_ctls, nmc, sizeof(*mc) * (sc->sc_nctls)); - free(sc->sc_ctls, M_USBDEV); + free(sc->sc_ctls, M_USBDEV, 0); } sc->sc_ctls = nmc; @@ -1402,13 +1402,13 @@ uaudio_io_terminaltype(int outtype, struct io_terminal *iot, int id) memcpy(tml, it->output, TERMINAL_LIST_SIZE(it->output->size)); tml->terminals[it->output->size] = outtype; tml->size++; - free(it->output, M_TEMP); + free(it->output, M_TEMP, 0); it->output = tml; if (it->inputs != NULL) { for (i = 0; i < it->inputs_size; i++) if (it->inputs[i] != NULL) - free(it->inputs[i], M_TEMP); - free(it->inputs, M_TEMP); + free(it->inputs[i], M_TEMP, 0); + free(it->inputs, M_TEMP, 0); } it->inputs_size = 0; it->inputs = NULL; @@ -1435,7 +1435,7 @@ uaudio_io_terminaltype(int outtype, struct io_terminal *iot, int id) tml = malloc(TERMINAL_LIST_SIZE(1), M_TEMP, M_NOWAIT); if (tml == NULL) { printf("uaudio_io_terminaltype: no memory\n"); - free(it->inputs, M_TEMP); + free(it->inputs, M_TEMP, 0); it->inputs = NULL; return NULL; } @@ -1557,7 +1557,7 @@ uaudio_add_alt(struct uaudio_softc *sc, const struct as_info *ai) /* Copy old data, if there was any */ if (sc->sc_nalts != 0) { bcopy(sc->sc_alts, nai, sizeof(*ai) * (sc->sc_nalts)); - free(sc->sc_alts, M_USBDEV); + free(sc->sc_alts, M_USBDEV, 0); } sc->sc_alts = nai; DPRINTFN(2,("uaudio_add_alt: adding alt=%d, enc=%d\n", @@ -1973,7 +1973,7 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc break; dp = (const usb_descriptor_t *)ibuf; if (ibuf + dp->bLength > ibufend) { - free(iot, M_TEMP); + free(iot, M_TEMP, 0); return (USBD_INVAL); } if (dp->bDescriptorType != UDESC_CS_INTERFACE) { @@ -1998,7 +1998,7 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc pot = iot[i].d.ot; tml = uaudio_io_terminaltype(UGETW(pot->wTerminalType), iot, i); if (tml != NULL) - free(tml, M_TEMP); + free(tml, M_TEMP, 0); } #ifdef UAUDIO_DEBUG @@ -2113,15 +2113,15 @@ uaudio_identify_ac(struct uaudio_softc *sc, const usb_config_descriptor_t *cdesc if (iot[i].inputs != NULL) { for (j = 0; j < iot[i].inputs_size; j++) { if (iot[i].inputs[j] != NULL) - free(iot[i].inputs[j], M_TEMP); + free(iot[i].inputs[j], M_TEMP, 0); } - free(iot[i].inputs, M_TEMP); + free(iot[i].inputs, M_TEMP, 0); } if (iot[i].output != NULL) - free(iot[i].output, M_TEMP); + free(iot[i].output, M_TEMP, 0); iot[i].d.desc = NULL; } - free(iot, M_TEMP); + free(iot, M_TEMP, 0); return (USBD_NORMAL_COMPLETION); } diff --git a/sys/dev/usb/ubcmtp.c b/sys/dev/usb/ubcmtp.c index 3b706d54512..e0ee7b085a7 100644 --- a/sys/dev/usb/ubcmtp.c +++ b/sys/dev/usb/ubcmtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubcmtp.c,v 1.5 2014/02/06 16:43:04 jcs Exp $ */ +/* $OpenBSD: ubcmtp.c,v 1.6 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2013-2014, joshua stein @@ -538,11 +538,11 @@ ubcmtp_disable(void *v) } if (sc->tp_pkt != NULL) { - free(sc->tp_pkt, M_USBDEV); + free(sc->tp_pkt, M_USBDEV, 0); sc->tp_pkt = NULL; } if (sc->bt_pkt != NULL) { - free(sc->bt_pkt, M_USBDEV); + free(sc->bt_pkt, M_USBDEV, 0); sc->bt_pkt = NULL; } } @@ -718,14 +718,14 @@ fail2: usbd_close_pipe(sc->sc_tp_pipe); } if (sc->tp_pkt != NULL) - free(sc->tp_pkt, M_USBDEV); + free(sc->tp_pkt, M_USBDEV, 0); fail1: if (sc->sc_bt_pipe != NULL) { usbd_abort_pipe(sc->sc_bt_pipe); usbd_close_pipe(sc->sc_bt_pipe); } if (sc->bt_pkt != NULL) - free(sc->bt_pkt, M_USBDEV); + free(sc->bt_pkt, M_USBDEV, 0); return (1); } diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index a071565b264..fbce92dc083 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsa.c,v 1.61 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: ubsa.c,v 1.62 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */ /*- * Copyright (c) 2002, Alexander Kabaev . @@ -376,7 +376,7 @@ ubsa_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -647,7 +647,7 @@ ubsa_close(void *addr, int portno) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c index 502b920b3c5..c2c136fd380 100644 --- a/sys/dev/usb/uchcom.c +++ b/sys/dev/usb/uchcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uchcom.c,v 1.20 2014/05/16 14:05:39 sasano Exp $ */ +/* $OpenBSD: uchcom.c,v 1.21 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */ /* @@ -843,7 +843,7 @@ uchcom_close_intr_pipe(struct uchcom_softc *sc) if (err) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index ca2beebe5d9..a1d7b07be7d 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucycom.c,v 1.27 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: ucycom.c,v 1.28 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */ /* @@ -301,11 +301,11 @@ ucycom_close(void *addr, int portno) s = splusb(); if (sc->sc_obuf != NULL) { - free(sc->sc_obuf, M_USBDEV); + free(sc->sc_obuf, M_USBDEV, 0); sc->sc_obuf = NULL; } if (sc->sc_ibuf != NULL) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_ibuf = NULL; } splx(s); diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index c34ad7721f9..abe5400f833 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.79 2013/12/06 21:03:05 deraadt Exp $ */ +/* $OpenBSD: udl.c,v 1.80 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2009 Marcus Glocker @@ -680,7 +680,7 @@ udl_free_screen(void *v, void *cookie) /* free character backing store */ if (sc->sc_cbs != NULL) - free(sc->sc_cbs, M_DEVBUF); + free(sc->sc_cbs, M_DEVBUF, 0); sc->sc_nscreens--; } @@ -1429,7 +1429,7 @@ void udl_free_huffman(struct udl_softc *sc) { if (sc->sc_huffman != NULL) { - free(sc->sc_huffman, M_DEVBUF); + free(sc->sc_huffman, M_DEVBUF, 0); sc->sc_huffman = NULL; sc->sc_huffman_size = 0; DPRINTF(1, "%s: huffman table freed\n", DN(sc)); @@ -1457,7 +1457,7 @@ void udl_fbmem_free(struct udl_softc *sc) { if (sc->sc_fbmem != NULL) { - free(sc->sc_fbmem, M_DEVBUF); + free(sc->sc_fbmem, M_DEVBUF, 0); sc->sc_fbmem = NULL; } } @@ -1528,7 +1528,7 @@ udl_cmd_free_buf(struct udl_softc *sc) struct udl_cmd_buf *cb = &sc->sc_cmd_buf; if (cb->buf != NULL) { - free(cb->buf, M_DEVBUF); + free(cb->buf, M_DEVBUF, 0); cb->buf = NULL; } cb->off = 0; diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 80d4a5e4511..fdea5456cf2 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.77 2014/07/11 08:45:29 mpi Exp $ */ +/* $OpenBSD: ugen.c,v 1.78 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -331,7 +331,7 @@ ugenopen(dev_t dev, int flag, int mode, struct proc *p) sce->ibuf, isize, ugenintr, USBD_DEFAULT_INTERVAL); if (err) { - free(sce->ibuf, M_USBDEV); + free(sce->ibuf, M_USBDEV, 0); clfree(&sce->q); return (EIO); } @@ -358,7 +358,7 @@ ugenopen(dev_t dev, int flag, int mode, struct proc *p) err = usbd_open_pipe(sce->iface, edesc->bEndpointAddress, 0, &sce->pipeh); if (err) { - free(sce->ibuf, M_USBDEV); + free(sce->ibuf, M_USBDEV, 0); return (EIO); } for(i = 0; i < UGEN_NISOREQS; ++i) { @@ -452,7 +452,7 @@ ugenclose(dev_t dev, int flag, int mode, struct proc *p) } if (sce->ibuf != NULL) { - free(sce->ibuf, M_USBDEV); + free(sce->ibuf, M_USBDEV, 0); sce->ibuf = NULL; } } @@ -1064,12 +1064,12 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, return (EINVAL); idesc = usbd_find_idesc(cdesc, ai->uai_interface_index, 0); if (idesc == NULL) { - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (EINVAL); } ai->uai_alt_no = usbd_get_no_alts(cdesc, idesc->bInterfaceNumber); - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); break; case USB_GET_DEVICE_DESC: *(usb_device_descriptor_t *)addr = @@ -1081,7 +1081,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, if (cdesc == NULL) return (EINVAL); cd->ucd_desc = *cdesc; - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); break; case USB_GET_INTERFACE_DESC: id = (struct usb_interface_desc *)addr; @@ -1095,11 +1095,11 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, alt = id->uid_alt_index; idesc = usbd_find_idesc(cdesc, id->uid_interface_index, alt); if (idesc == NULL) { - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (EINVAL); } id->uid_desc = *idesc; - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); break; case USB_GET_ENDPOINT_DESC: ed = (struct usb_endpoint_desc *)addr; @@ -1114,11 +1114,11 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, edesc = usbd_find_edesc(cdesc, ed->ued_interface_index, alt, ed->ued_endpoint_index); if (edesc == NULL) { - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (EINVAL); } ed->ued_desc = *edesc; - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); break; case USB_GET_FULL_DESC: { @@ -1143,7 +1143,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, uio.uio_rw = UIO_READ; uio.uio_procp = p; error = uiomove((void *)cdesc, len, &uio); - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (error); } case USB_GET_STRING_DESC: @@ -1216,7 +1216,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, } ret: if (ptr) - free(ptr, M_TEMP); + free(ptr, M_TEMP, 0); return (error); } case USB_GET_DEVICEINFO: diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 52e78531f7c..a2ca6f10226 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.126 2014/07/10 20:57:40 mpi Exp $ */ +/* $OpenBSD: uhci.c,v 1.127 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -1992,7 +1992,7 @@ uhci_device_intr_close(struct usbd_pipe *pipe) for(i = 0; i < npoll; i++) uhci_free_sqh(sc, upipe->u.intr.qhs[i]); - free(upipe->u.intr.qhs, M_USBHC); + free(upipe->u.intr.qhs, M_USBHC, 0); /* XXX free other resources */ } @@ -2357,7 +2357,7 @@ uhci_device_isoc_close(struct usbd_pipe *pipe) } splx(s); - free(iso->stds, M_USBHC); + free(iso->stds, M_USBHC, 0); } usbd_status @@ -2411,7 +2411,7 @@ uhci_setup_isoc(struct usbd_pipe *pipe) bad: while (--i >= 0) uhci_free_std(sc, iso->stds[i]); - free(iso->stds, M_USBHC); + free(iso->stds, M_USBHC, 0); return (USBD_NOMEM); } @@ -2641,7 +2641,7 @@ uhci_device_setintr(struct uhci_softc *sc, struct uhci_pipe *upipe, int ival) if (sqh == NULL) { while (i > 0) uhci_free_sqh(sc, qhs[--i]); - free(qhs, M_USBHC); + free(qhs, M_USBHC, 0); return (USBD_NOMEM); } sqh->elink = NULL; diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 51b3e89a8ba..429282c8f06 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.57 2014/04/15 09:14:27 mpi Exp $ */ +/* $OpenBSD: uhid.c,v 1.58 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -247,7 +247,7 @@ uhidclose(dev_t dev, int flag, int mode, struct proc *p) DPRINTF(("uhidclose: sc=%p\n", sc)); clfree(&sc->sc_q); - free(sc->sc_obuf, M_USBDEV); + free(sc->sc_obuf, M_USBDEV, 0); sc->sc_async = NULL; uhidev_close(&sc->sc_hdev); diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index e2eb0c8f0f3..dde8ace2469 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.61 2014/07/10 08:56:40 mpi Exp $ */ +/* $OpenBSD: uhidev.c,v 1.62 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -198,7 +198,7 @@ uhidev_attach(struct device *parent, struct device *self, void *aux) if (usbd_get_report_descriptor(sc->sc_udev, sc->sc_ifaceno, desc, size)) { printf("%s: no report descriptor\n", DEVNAME(sc)); - free(desc, M_USBDEV); + free(desc, M_USBDEV, 0); return; } } @@ -391,7 +391,7 @@ uhidev_detach(struct device *self, int flags) } if (sc->sc_repdesc != NULL) - free(sc->sc_repdesc, M_USBDEV); + free(sc->sc_repdesc, M_USBDEV, 0); /* * XXX Check if we have only one children claiming all the Report @@ -559,7 +559,7 @@ out2: usbd_close_pipe(sc->sc_ipipe); out1: DPRINTF(("uhidev_open: failed in someway")); - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); scd->sc_state &= ~UHIDEV_OPEN; sc->sc_refcnt = 0; sc->sc_ipipe = NULL; @@ -620,7 +620,7 @@ uhidev_close(struct uhidev *scd) } if (sc->sc_ibuf != NULL) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_ibuf = NULL; } } @@ -643,7 +643,7 @@ uhidev_set_report(struct uhidev *scd, int type, int id, void *data, int len) retstat = usbd_set_report(sc->sc_udev, sc->sc_ifaceno, type, id, buf, len + 1); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return retstat; } @@ -674,7 +674,7 @@ uhidev_set_report_async(struct uhidev *scd, int type, int id, void *data, * the buffer right after submitting the transfer because * it won't be used afterward. */ - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return retstat; } diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index f8427849add..dde6dba4d41 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.68 2014/07/09 18:15:04 mpi Exp $ */ +/* $OpenBSD: uhub.c,v 1.69 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -177,7 +177,7 @@ uhub_attach(struct device *parent, struct device *self, void *aux) hub->ports = malloc(sizeof(struct usbd_port) * nports, M_USBDEV, M_NOWAIT); if (hub->ports == NULL) { - free(hub, M_USBDEV); + free(hub, M_USBDEV, 0); return; } dev->hub = hub; @@ -302,11 +302,11 @@ uhub_attach(struct device *parent, struct device *self, void *aux) bad: if (sc->sc_statusbuf) - free(sc->sc_statusbuf, M_USBDEV); + free(sc->sc_statusbuf, M_USBDEV, 0); if (hub) { if (hub->ports) - free(hub->ports, M_USBDEV); - free(hub, M_USBDEV); + free(hub->ports, M_USBDEV, 0); + free(hub, M_USBDEV, 0); } dev->hub = NULL; } @@ -496,12 +496,12 @@ uhub_detach(struct device *self, int flags) } if (hub->ports[0].tt) - free(hub->ports[0].tt, M_USBDEV); + free(hub->ports[0].tt, M_USBDEV, 0); if (sc->sc_statusbuf) - free(sc->sc_statusbuf, M_USBDEV); + free(sc->sc_statusbuf, M_USBDEV, 0); if (hub->ports) - free(hub->ports, M_USBDEV); - free(hub, M_USBDEV); + free(hub->ports, M_USBDEV, 0); + free(hub, M_USBDEV, 0); sc->sc_hub->hub = NULL; return (0); diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index 00e6974c84e..81ae3d146a7 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.45 2013/11/07 13:11:10 pirofti Exp $ */ +/* $OpenBSD: ulpt.c,v 1.46 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -726,7 +726,7 @@ close_pipe: usbd_close_pipe(sc->sc_out_pipe); sc->sc_out_pipe = NULL; free_ucode: - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 34d203b6afe..db62a364596 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.65 2013/11/06 14:37:31 pirofti Exp $ */ +/* $OpenBSD: umass.c,v 1.66 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */ /* @@ -656,7 +656,7 @@ umass_detach(struct device *self, int flags) if (scbus != NULL) { if (scbus->sc_child != NULL) rv = config_detach(scbus->sc_child, flags); - free(scbus, M_DEVBUF); + free(scbus, M_DEVBUF, 0); sc->bus = NULL; } diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 6fc031809c3..dac07953d91 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.39 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: umct.c,v 1.40 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -315,7 +315,7 @@ umct_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -570,7 +570,7 @@ umct_close(void *addr, int portno) if (err) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index 695f342c05a..141cef9a86f 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi.c,v 1.38 2013/11/10 10:22:39 pirofti Exp $ */ +/* $OpenBSD: umidi.c,v 1.39 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -414,7 +414,7 @@ alloc_all_endpoints(struct umidi_softc *sc) ep--; free_pipe(ep); } - free(sc->sc_endpoints, M_USBDEV); + free(sc->sc_endpoints, M_USBDEV, 0); sc->sc_endpoints = sc->sc_out_ep = sc->sc_in_ep = NULL; break; } @@ -430,7 +430,7 @@ free_all_endpoints(struct umidi_softc *sc) for (i=0; isc_in_num_endpoints+sc->sc_out_num_endpoints; i++) free_pipe(&sc->sc_endpoints[i]); if (sc->sc_endpoints != NULL) - free(sc->sc_endpoints, M_USBDEV); + free(sc->sc_endpoints, M_USBDEV, 0); sc->sc_endpoints = sc->sc_out_ep = sc->sc_in_ep = NULL; } @@ -518,7 +518,7 @@ alloc_all_endpoints_fixed_ep(struct umidi_softc *sc) return USBD_NORMAL_COMPLETION; error: - free(sc->sc_endpoints, M_USBDEV); + free(sc->sc_endpoints, M_USBDEV, 0); sc->sc_endpoints = NULL; return err; } @@ -794,7 +794,7 @@ free_all_jacks(struct umidi_softc *sc) s = splusb(); if (sc->sc_out_jacks) { - free(sc->sc_jacks, M_USBDEV); + free(sc->sc_jacks, M_USBDEV, 0); sc->sc_jacks = sc->sc_in_jacks = sc->sc_out_jacks = NULL; } splx(s); @@ -981,7 +981,7 @@ free_all_mididevs(struct umidi_softc *sc) { sc->sc_num_mididevs = 0; if (sc->sc_mididevs) - free(sc->sc_mididevs, M_USBDEV); + free(sc->sc_mididevs, M_USBDEV, 0); } static usbd_status diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c index 718ee216d4a..9737f9afe3b 100644 --- a/sys/dev/usb/umsm.c +++ b/sys/dev/usb/umsm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umsm.c,v 1.98 2014/05/16 13:53:35 dcoppa Exp $ */ +/* $OpenBSD: umsm.c,v 1.99 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2008 Yojiro UO @@ -419,7 +419,7 @@ umsm_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -492,7 +492,7 @@ umsm_close(void *addr, int portno) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/usb/uoaklux.c b/sys/dev/usb/uoaklux.c index 9a3b2403cc4..109641a4fd3 100644 --- a/sys/dev/usb/uoaklux.c +++ b/sys/dev/usb/uoaklux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoaklux.c,v 1.8 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: uoaklux.c,v 1.9 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -212,7 +212,7 @@ uoaklux_detach(struct device *self, int flags) uhidev_close(&sc->sc_hdev); if (scc->sc_ibuf != NULL) { - free(scc->sc_ibuf, M_USBDEV); + free(scc->sc_ibuf, M_USBDEV, 0); scc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/uoakrh.c b/sys/dev/usb/uoakrh.c index 0540e2d3a13..b61ec037374 100644 --- a/sys/dev/usb/uoakrh.c +++ b/sys/dev/usb/uoakrh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoakrh.c,v 1.9 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: uoakrh.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -228,7 +228,7 @@ uoakrh_detach(struct device *self, int flags) uhidev_close(&sc->sc_hdev); if (scc->sc_ibuf != NULL) { - free(scc->sc_ibuf, M_USBDEV); + free(scc->sc_ibuf, M_USBDEV, 0); scc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/uoakv.c b/sys/dev/usb/uoakv.c index 40093d57e5f..77e233b4d56 100644 --- a/sys/dev/usb/uoakv.c +++ b/sys/dev/usb/uoakv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoakv.c,v 1.8 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: uoakv.c,v 1.9 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -216,7 +216,7 @@ uoakv_detach(struct device *self, int flags) uhidev_close(&sc->sc_hdev); if (scc->sc_ibuf != NULL) { - free(scc->sc_ibuf, M_USBDEV); + free(scc->sc_ibuf, M_USBDEV, 0); scc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/upd.c b/sys/dev/usb/upd.c index 8ef208c01fc..1772d1fa47f 100644 --- a/sys/dev/usb/upd.c +++ b/sys/dev/usb/upd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: upd.c,v 1.9 2014/05/12 09:50:44 mpi Exp $ */ +/* $OpenBSD: upd.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */ /* * Copyright (c) 2014 Andre de Oliveira @@ -251,8 +251,8 @@ upd_detach(struct device *self, int flags) DPRINTF(("upd_detach: %s\n", sensor->ksensor.desc)); } - free(sc->sc_reports, M_USBDEV); - free(sc->sc_sensors, M_USBDEV); + free(sc->sc_reports, M_USBDEV, 0); + free(sc->sc_sensors, M_USBDEV, 0); DPRINTF(("upd_detach: complete\n")); return (0); } diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c index ec0454c5909..ef43afcaf3b 100644 --- a/sys/dev/usb/uplcom.c +++ b/sys/dev/usb/uplcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uplcom.c,v 1.62 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: uplcom.c,v 1.63 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -422,7 +422,7 @@ uplcom_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -752,7 +752,7 @@ uplcom_close(void *addr, int portno) if (err) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c index 73b7a22f1b9..0524914dac4 100644 --- a/sys/dev/usb/urio.c +++ b/sys/dev/usb/urio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urio.c,v 1.44 2013/11/07 13:10:43 pirofti Exp $ */ +/* $OpenBSD: urio.c,v 1.45 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */ /* @@ -504,7 +504,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) ret: if (ptr != NULL) - free(ptr, M_TEMP); + free(ptr, M_TEMP, 0); return (error); } diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 8b5dc95161b..7a1b3ae2b96 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.99 2014/07/11 08:43:38 mpi Exp $ */ +/* $OpenBSD: usb.c,v 1.100 2014/07/12 18:48:52 tedu Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -542,7 +542,7 @@ usb_fill_udc_task(void *arg) if (cdesc == NULL) return; udc->udc_desc = *cdesc; - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); } void @@ -661,7 +661,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) } ret: if (ptr) - free(ptr, M_TEMP); + free(ptr, M_TEMP, 0); return (error); } @@ -783,7 +783,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) uio.uio_rw = UIO_READ; uio.uio_procp = p; error = uiomove((void *)cdesc, len, &uio); - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (error); } diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c index 7eca6e7ba67..904a6ec7728 100644 --- a/sys/dev/usb/usb_mem.c +++ b/sys/dev/usb/usb_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_mem.c,v 1.25 2013/04/15 09:23:02 mglocker Exp $ */ +/* $OpenBSD: usb_mem.c,v 1.26 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */ /* @@ -162,7 +162,7 @@ unmap: free1: bus_dmamem_free(tag, p->segs, p->nsegs); free0: - free(p, M_USB); + free(p, M_USB, 0); return (USBD_NOMEM); } @@ -180,7 +180,7 @@ usb_block_real_freemem(struct usb_dma_block *p) bus_dmamap_destroy(p->tag, p->map); bus_dmamem_unmap(p->tag, p->kaddr, p->size); bus_dmamem_free(p->tag, p->segs, p->nsegs); - free(p, M_USB); + free(p, M_USB, 0); } #endif diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 3e8cf514b92..d42c45ca2ec 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_subr.c,v 1.105 2014/07/12 07:18:16 mpi Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.106 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -570,7 +570,7 @@ usbd_fill_iface_data(struct usbd_device *dev, int ifaceidx, int altidx) bad: if (ifc->endpoints != NULL) { - free(ifc->endpoints, M_USB); + free(ifc->endpoints, M_USB, 0); ifc->endpoints = NULL; } return (USBD_INVAL); @@ -581,7 +581,7 @@ usbd_free_iface_data(struct usbd_device *dev, int ifcno) { struct usbd_interface *ifc = &dev->ifaces[ifcno]; if (ifc->endpoints) - free(ifc->endpoints, M_USB); + free(ifc->endpoints, M_USB, 0); } usbd_status @@ -634,8 +634,8 @@ usbd_set_config_index(struct usbd_device *dev, int index, int msg) nifc = dev->cdesc->bNumInterface; for (ifcidx = 0; ifcidx < nifc; ifcidx++) usbd_free_iface_data(dev, ifcidx); - free(dev->ifaces, M_USB); - free(dev->cdesc, M_USB); + free(dev->ifaces, M_USB, 0); + free(dev->cdesc, M_USB, 0); dev->ifaces = NULL; dev->cdesc = NULL; dev->config = USB_UNCONFIG_NO; @@ -780,7 +780,7 @@ usbd_set_config_index(struct usbd_device *dev, int index, int msg) return (USBD_NORMAL_COMPLETION); bad: - free(cdp, M_USB); + free(cdp, M_USB, 0); return (err); } @@ -808,7 +808,7 @@ usbd_setup_pipe(struct usbd_device *dev, struct usbd_interface *iface, if (err) { DPRINTF(("%s: endpoint=0x%x failed, error=%s\n", __func__, ep->edesc->bEndpointAddress, usbd_errstr(err))); - free(p, M_USB); + free(p, M_USB, 0); return (err); } *pipe = p; @@ -924,7 +924,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port, len = (nifaces + 2) * sizeof dv; dev->subdevs = malloc(len, M_USB, M_NOWAIT | M_ZERO); if (dev->subdevs == NULL) { - free(ifaces, M_USB); + free(ifaces, M_USB, 0); err = USBD_NOMEM; goto fail; } @@ -941,7 +941,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port, usbd_claim_iface(dev, i); } } - free(ifaces, M_USB); + free(ifaces, M_USB, 0); if (dev->ndevs > 0) { for (i = 0; i < nifaces; i++) { @@ -954,7 +954,7 @@ usbd_probe_and_attach(struct device *parent, struct usbd_device *dev, int port, goto fail; } - free(dev->subdevs, M_USB); + free(dev->subdevs, M_USB, 0); dev->subdevs = NULL; } /* No interfaces were attached in any of the configurations. */ @@ -1273,7 +1273,7 @@ usbd_print(void *aux, const char *pnp) DPRINTFN(15, ("usbd_print dev=%p\n", uaa->device)); if (pnp) { if (!uaa->usegeneric) { - free(devinfop, M_TEMP); + free(devinfop, M_TEMP, 0); return (QUIET); } printf("%s at %s", devinfop, pnp); @@ -1287,7 +1287,7 @@ usbd_print(void *aux, const char *pnp) if (!pnp) printf(" %s\n", devinfop); - free(devinfop, M_TEMP); + free(devinfop, M_TEMP, 0); return (UNCONF); } @@ -1422,7 +1422,7 @@ usbd_get_cdesc(struct usbd_device *dev, int index, int *lenp) cdesc = malloc(len, M_TEMP, M_WAITOK); err = usbd_get_desc(dev, UDESC_CONFIG, index, len, cdesc); if (err) { - free(cdesc, M_TEMP); + free(cdesc, M_TEMP, 0); return (0); } } @@ -1444,15 +1444,15 @@ usb_free_device(struct usbd_device *dev) nifc = dev->cdesc->bNumInterface; for (ifcidx = 0; ifcidx < nifc; ifcidx++) usbd_free_iface_data(dev, ifcidx); - free(dev->ifaces, M_USB); + free(dev->ifaces, M_USB, 0); } if (dev->cdesc != NULL) - free(dev->cdesc, M_USB); + free(dev->cdesc, M_USB, 0); if (dev->subdevs != NULL) - free(dev->subdevs, M_USB); + free(dev->subdevs, M_USB, 0); dev->bus->devices[dev->address] = NULL; - free(dev, M_USB); + free(dev, M_USB, 0); } /* diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 202b09dd578..c83218b2db4 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.70 2014/03/07 09:38:14 mpi Exp $ */ +/* $OpenBSD: usbdi.c,v 1.71 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -273,7 +273,7 @@ usbd_close_pipe(struct usbd_pipe *pipe) pipe->methods->close(pipe); if (pipe->intrxfer != NULL) usbd_free_xfer(pipe->intrxfer); - free(pipe, M_USB); + free(pipe, M_USB, 0); return (USBD_NORMAL_COMPLETION); } @@ -652,7 +652,7 @@ usbd_set_interface(struct usbd_interface *iface, int altidx) /* new setting works, we can free old endpoints */ if (endpoints != NULL) - free(endpoints, M_USB); + free(endpoints, M_USB, 0); #ifdef DIAGNOSTIC if (iface->idesc == NULL) { diff --git a/sys/dev/usb/usbf_subr.c b/sys/dev/usb/usbf_subr.c index 4269d12ef6a..e27e76ebc90 100644 --- a/sys/dev/usb/usbf_subr.c +++ b/sys/dev/usb/usbf_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbf_subr.c,v 1.18 2014/03/07 18:56:14 mpi Exp $ */ +/* $OpenBSD: usbf_subr.c,v 1.19 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler @@ -74,7 +74,7 @@ usbf_realloc(void **pp, size_t *sizep, size_t newsize) if (newsize == 0) { if (*sizep > 0) - free(*pp, M_USB); + free(*pp, M_USB, 0); *pp = NULL; *sizep = 0; return NULL; @@ -90,7 +90,7 @@ usbf_realloc(void **pp, size_t *sizep, size_t newsize) #if 0 /* XXX must leak for now; something unknown has a pointer */ if (*pp != NULL) - free(*pp, M_USB); + free(*pp, M_USB, 0); #endif *pp = p; *sizep = newsize; @@ -141,7 +141,7 @@ usbf_remove_device(struct usbf_device *dev, struct usbf_port *up) if (dev->default_pipe != NULL) usbf_close_pipe(dev->default_pipe); up->device = NULL; - free(dev, M_USB); + free(dev, M_USB, 0); } usbf_status @@ -193,7 +193,7 @@ usbf_new_device(struct device *parent, struct usbf_bus *bus, int depth, err = usbf_setup_pipe(dev, NULL, &dev->def_ep, 0, &dev->default_pipe); if (err) { - free(dev, M_USB); + free(dev, M_USB, 0); return err; } @@ -204,7 +204,7 @@ usbf_new_device(struct device *parent, struct usbf_bus *bus, int depth, if (dev->default_xfer != NULL) usbf_free_xfer(dev->default_xfer); usbf_close_pipe(dev->default_pipe); - free(dev, M_USB); + free(dev, M_USB, 0); return USBF_NOMEM; } @@ -216,7 +216,7 @@ usbf_new_device(struct device *parent, struct usbf_bus *bus, int depth, usbf_free_xfer(dev->default_xfer); usbf_free_xfer(dev->data_xfer); usbf_close_pipe(dev->default_pipe); - free(dev, M_USB); + free(dev, M_USB, 0); return err; } @@ -289,7 +289,7 @@ void usbf_devinfo_free(char *devinfo) { if (devinfo != NULL) - free(devinfo, M_USB); + free(devinfo, M_USB, 0); } /* @@ -407,7 +407,7 @@ usbf_add_config(struct usbf_device *dev, struct usbf_config **ucp) cd = malloc(sizeof *cd, M_USB, M_NOWAIT | M_ZERO); if (cd == NULL) { - free(uc, M_USB); + free(uc, M_USB, 0); return USBF_NOMEM; } @@ -483,7 +483,7 @@ usbf_add_interface(struct usbf_config *uc, u_int8_t bInterfaceClass, id = malloc(sizeof *id, M_USB, M_NOWAIT | M_ZERO); if (id == NULL) { - free(ui, M_USB); + free(ui, M_USB, 0); return USBF_NOMEM; } @@ -524,7 +524,7 @@ usbf_add_endpoint(struct usbf_interface *ui, u_int8_t bEndpointAddress, ed = malloc(sizeof *ed, M_USB, M_NOWAIT | M_ZERO); if (ed == NULL) { - free(ue, M_USB); + free(ue, M_USB, 0); return USBF_NOMEM; } @@ -566,7 +566,7 @@ usbf_end_config(struct usbf_config *uc) if (err) break; - free(ui->idesc, M_USB); + free(ui->idesc, M_USB, 0); ui->idesc = (usb_interface_descriptor_t *)d; SIMPLEQ_FOREACH(ue, &ui->endpoint_head, next) { @@ -575,7 +575,7 @@ usbf_end_config(struct usbf_config *uc) if (err) break; - free(ue->edesc, M_USB); + free(ue->edesc, M_USB, 0); ue->edesc = (usb_endpoint_descriptor_t *)d; } } @@ -671,7 +671,7 @@ usbf_setup_pipe(struct usbf_device *dev, struct usbf_interface *iface, SIMPLEQ_INIT(&p->queue); err = dev->bus->methods->open_pipe(p); if (err) { - free(p, M_USB); + free(p, M_USB, 0); return err; } *pipe = p; @@ -707,7 +707,7 @@ usbf_close_pipe(struct usbf_pipe *pipe) usbf_abort_pipe(pipe); pipe->methods->close(pipe); pipe->endpoint->refcnt--; - free(pipe, M_USB); + free(pipe, M_USB, 0); } void diff --git a/sys/dev/usb/usps.c b/sys/dev/usb/usps.c index 9b947371183..1f47fca9bad 100644 --- a/sys/dev/usb/usps.c +++ b/sys/dev/usb/usps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usps.c,v 1.5 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: usps.c,v 1.6 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2011 Yojiro UO @@ -297,7 +297,7 @@ fail: if (sc->sc_xfer != NULL) usbd_free_xfer(sc->sc_xfer); if (sc->sc_intrbuf != NULL) - free(sc->sc_intrbuf, M_USBDEV); + free(sc->sc_intrbuf, M_USBDEV, 0); } int @@ -313,7 +313,7 @@ usps_detach(struct device *self, int flags) usbd_abort_pipe(sc->sc_ipipe); usbd_close_pipe(sc->sc_ipipe); if (sc->sc_intrbuf != NULL) - free(sc->sc_intrbuf, M_USBDEV); + free(sc->sc_intrbuf, M_USBDEV, 0); sc->sc_ipipe = NULL; } if (sc->sc_xfer != NULL) diff --git a/sys/dev/usb/uticom.c b/sys/dev/usb/uticom.c index 2ddd7718724..d214c6485fe 100644 --- a/sys/dev/usb/uticom.c +++ b/sys/dev/usb/uticom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uticom.c,v 1.24 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: uticom.c,v 1.25 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2005 Dmitry Komissaroff . * @@ -486,7 +486,7 @@ uticom_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -786,7 +786,7 @@ uticom_close(void *addr, int portno) if (err) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } @@ -920,7 +920,7 @@ uticom_download_fw(struct uticom_softc *sc, int pipeno, if (!buffer) { printf("%s: uticom_download_fw: out of memory\n", sc->sc_dev.dv_xname); - free(firmware, M_DEVBUF); + free(firmware, M_DEVBUF, 0); return ENOMEM; } @@ -970,12 +970,12 @@ uticom_download_fw(struct uticom_softc *sc, int pipeno, sc->sc_dev.dv_xname, usbd_errstr(err)); finish: - free(firmware, M_DEVBUF); + free(firmware, M_DEVBUF, 0); usbd_free_buffer(oxfer); usbd_free_xfer(oxfer); oxfer = NULL; usbd_abort_pipe(pipe); usbd_close_pipe(pipe); - free(buffer, M_USBDEV); + free(buffer, M_USBDEV, 0); return err; } diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c index 451734de700..a60af099744 100644 --- a/sys/dev/usb/utrh.c +++ b/sys/dev/usb/utrh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utrh.c,v 1.15 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: utrh.c,v 1.16 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2009 Yojiro UO @@ -179,7 +179,7 @@ utrh_detach(struct device *self, int flags) uhidev_close(&sc->sc_hdev); if (sc->sc_ibuf != NULL) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c index 4c1fd0fc20f..d3759f797a0 100644 --- a/sys/dev/usb/uts.c +++ b/sys/dev/usb/uts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uts.c,v 1.33 2014/03/07 18:39:02 mpi Exp $ */ +/* $OpenBSD: uts.c,v 1.34 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2007 Robert Nagy @@ -278,7 +278,7 @@ uts_enable(void *v) USBD_SHORT_XFER_OK, &sc->sc_intr_pipe, sc, sc->sc_ibuf, sc->sc_isize, uts_intr, USBD_DEFAULT_INTERVAL); if (err) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; return (EIO); } @@ -307,7 +307,7 @@ uts_disable(void *v) } if (sc->sc_ibuf != NULL) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/utwitch.c b/sys/dev/usb/utwitch.c index 2f7c0c0dcc4..62d7f73ffd0 100644 --- a/sys/dev/usb/utwitch.c +++ b/sys/dev/usb/utwitch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utwitch.c,v 1.12 2014/05/07 08:17:21 mpi Exp $ */ +/* $OpenBSD: utwitch.c,v 1.13 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2010 Yojiro UO @@ -193,7 +193,7 @@ utwitch_detach(struct device *self, int flags) uhidev_close(&sc->sc_hdev); if (sc->sc_ibuf != NULL) { - free(sc->sc_ibuf, M_USBDEV); + free(sc->sc_ibuf, M_USBDEV, 0); sc->sc_ibuf = NULL; } diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index 183f5612eb3..492cd0c1f81 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.174 2014/01/22 03:21:23 jsg Exp $ */ +/* $OpenBSD: uvideo.c,v 1.175 2014/07/12 18:48:53 tedu Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -1624,12 +1624,12 @@ uvideo_vs_free_frame(struct uvideo_softc *sc) struct uvideo_frame_buffer *fb = &sc->sc_frame_buffer; if (fb->buf != NULL) { - free(fb->buf, M_DEVBUF); + free(fb->buf, M_DEVBUF, 0); fb->buf = NULL; } if (sc->sc_mmap_buffer != NULL) { - free(sc->sc_mmap_buffer, M_DEVBUF); + free(sc->sc_mmap_buffer, M_DEVBUF, 0); sc->sc_mmap_buffer = NULL; } @@ -3343,7 +3343,7 @@ uvideo_queryctrl(void *v, struct v4l2_queryctrl *qctrl) qctrl->flags = 0; out: - free(ctrl_data, M_USBDEV); + free(ctrl_data, M_USBDEV, 0); return (ret); } @@ -3394,7 +3394,7 @@ uvideo_g_ctrl(void *v, struct v4l2_control *gctrl) } out: - free(ctrl_data, M_USBDEV); + free(ctrl_data, M_USBDEV, 0); return (0); } @@ -3441,7 +3441,7 @@ uvideo_s_ctrl(void *v, struct v4l2_control *sctrl) if (error != USBD_NORMAL_COMPLETION) ret = EINVAL; - free(ctrl_data, M_USBDEV); + free(ctrl_data, M_USBDEV, 0); return (ret); } @@ -3585,7 +3585,7 @@ uvideo_ucode_loader_ricoh(struct uvideo_softc *sc) while (remain > 0) { if (remain < 3) { printf("%s: ucode file incomplete!\n", DEVNAME(sc)); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (USBD_INVAL); } @@ -3599,7 +3599,7 @@ uvideo_ucode_loader_ricoh(struct uvideo_softc *sc) if (error != USBD_NORMAL_COMPLETION) { printf("%s: ucode upload error=%s!\n", DEVNAME(sc), usbd_errstr(error)); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (USBD_INVAL); } DPRINTF(1, "%s: uploaded %d bytes ucode to addr 0x%x\n", @@ -3608,7 +3608,7 @@ uvideo_ucode_loader_ricoh(struct uvideo_softc *sc) offset += len; remain -= len; } - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); /* activate microcode */ cbuf = 0; @@ -3664,7 +3664,7 @@ uvideo_ucode_loader_apple_isight(struct uvideo_softc *sc) if (len < 1 || len > 1023) { printf("%s: ucode header contains wrong value!\n", DEVNAME(sc)); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (USBD_INVAL); } code += 4; @@ -3681,14 +3681,14 @@ uvideo_ucode_loader_apple_isight(struct uvideo_softc *sc) if (error) { printf("%s: ucode load failed: %s\n", DEVNAME(sc), usbd_errstr(error)); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (USBD_INVAL); } code += llen; } } - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); /* send finished request */ cbuf = 0; diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index 56900b76299..e14b30606ab 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvscom.c,v 1.30 2013/11/15 10:17:39 pirofti Exp $ */ +/* $OpenBSD: uvscom.c,v 1.31 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama . @@ -372,7 +372,7 @@ uvscom_detach(struct device *self, int flags) if (sc->sc_intr_pipe != NULL) { usbd_abort_pipe(sc->sc_intr_pipe); usbd_close_pipe(sc->sc_intr_pipe); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } @@ -779,7 +779,7 @@ uvscom_close(void *addr, int portno) printf("%s: close interrupt pipe failed: %s\n", sc->sc_dev.dv_xname, usbd_errstr(err)); - free(sc->sc_intr_buf, M_USBDEV); + free(sc->sc_intr_buf, M_USBDEV, 0); sc->sc_intr_pipe = NULL; } } diff --git a/sys/dev/video.c b/sys/dev/video.c index 642c7274cc5..0363039a488 100644 --- a/sys/dev/video.c +++ b/sys/dev/video.c @@ -1,4 +1,4 @@ -/* $OpenBSD: video.c,v 1.30 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: video.c,v 1.31 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -431,7 +431,7 @@ videodetach(struct device *self, int flags) int maj, mn; if (sc->sc_fbuffer != NULL) - free(sc->sc_fbuffer, M_DEVBUF); + free(sc->sc_fbuffer, M_DEVBUF, 0); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) diff --git a/sys/dev/vmt.c b/sys/dev/vmt.c index 4e586bc8c73..1b8b0374254 100644 --- a/sys/dev/vmt.c +++ b/sys/dev/vmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmt.c,v 1.18 2014/07/11 08:18:31 guenther Exp $ */ +/* $OpenBSD: vmt.c,v 1.19 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2007 David Crawshaw @@ -308,7 +308,7 @@ vmt_attach(struct device *parent, struct device *self, void *aux) return; free: - free(sc->sc_rpc_buf, M_DEVBUF); + free(sc->sc_rpc_buf, M_DEVBUF, 0); } int diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index afc44763371..c59acc44d1c 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.152 2013/11/12 14:11:07 krw Exp $ */ +/* $OpenBSD: vnd.c,v 1.153 2014/07/12 18:48:51 tedu Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -537,7 +537,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) /* Free crypto key */ if (sc->sc_keyctx) { explicit_bzero(sc->sc_keyctx, sizeof(*sc->sc_keyctx)); - free(sc->sc_keyctx, M_DEVBUF); + free(sc->sc_keyctx, M_DEVBUF, 0); } /* Detach the disk. */ @@ -579,7 +579,7 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); vndgetdisklabel(dev, sc, lp, 0); *(sc->sc_dk.dk_label) = *lp; - free(lp, M_TEMP); + free(lp, M_TEMP, 0); return (0); case DIOCGPDINFO: @@ -651,7 +651,7 @@ vndsetcred(struct vnd_softc *sc, struct ucred *cred) error = vn_rdwr(UIO_READ, sc->sc_vp, buf, size, 0, UIO_SYSSPACE, 0, sc->sc_cred, NULL, curproc); - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return (error); } diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 13497a2b272..5f22a71886c 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.29 2014/04/22 08:48:51 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.30 2014/07/12 18:48:51 tedu Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -530,7 +530,7 @@ vscsi_devevent_task(void *xsc, void *xdt) gone: device_unref(&sc->sc_dev); - free(dt, M_TEMP); + free(dt, M_TEMP, 0); } int diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index a9362169a54..87b2378b648 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.118 2014/05/14 18:11:24 shadchin Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.119 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -310,8 +310,8 @@ wsscreen_attach(struct wsdisplay_softc *sc, int console, const char *emul, fail: if (dconf != NULL) - free(dconf, M_DEVBUF); - free(scr, M_DEVBUF); + free(dconf, M_DEVBUF, 0); + free(scr, M_DEVBUF, 0); return (NULL); } @@ -326,8 +326,8 @@ wsscreen_detach(struct wsscreen *scr) } (*scr->scr_dconf->wsemul->detach)(scr->scr_dconf->wsemulcookie, &ccol, &crow); - free(scr->scr_dconf, M_DEVBUF); - free(scr, M_DEVBUF); + free(scr->scr_dconf, M_DEVBUF, 0); + free(scr, M_DEVBUF, 0); } const struct wsscreen_descr * @@ -1349,14 +1349,14 @@ wsdisplay_cfg_ioctl(struct wsdisplay_softc *sc, u_long cmd, caddr_t data, buf = malloc(fontsz, M_DEVBUF, M_WAITOK); error = copyin(d->data, buf, fontsz); if (error) { - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (error); } d->data = buf; error = (*sc->sc_accessops->load_font)(sc->sc_accesscookie, 0, d); if (error) - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (error); case WSDISPLAYIO_LSFONT: @@ -3356,7 +3356,7 @@ allocate_copybuffer(struct wsdisplay_softc *sc) } if (size != sc->sc_copybuffer_size && sc->sc_copybuffer_size != 0) { bzero(sc->sc_copybuffer, sc->sc_copybuffer_size); - free(sc->sc_copybuffer, M_DEVBUF); + free(sc->sc_copybuffer, M_DEVBUF, 0); } if ((sc->sc_copybuffer = (char *)malloc(size, M_DEVBUF, M_NOWAIT)) == NULL) { diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c index f6e885c881d..1b43e4b6697 100644 --- a/sys/dev/wscons/wsdisplay_compat_usl.c +++ b/sys/dev/wscons/wsdisplay_compat_usl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay_compat_usl.c,v 1.25 2014/04/18 21:18:50 guenther Exp $ */ +/* $OpenBSD: wsdisplay_compat_usl.c,v 1.26 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsdisplay_compat_usl.c,v 1.12 2000/03/23 07:01:47 thorpej Exp $ */ /* @@ -115,7 +115,7 @@ usl_sync_init(struct wsscreen *scr, struct usl_syncdata **sdp, timeout_set(&sd->s_detach_ch, usl_detachtimeout, sd); res = wsscreen_attach_sync(scr, &usl_syncops, sd); if (res) { - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); return (res); } *sdp = sd; @@ -134,7 +134,7 @@ usl_sync_done(struct usl_syncdata *sd) (*sd->s_callback)(sd->s_cbarg, ENXIO, 0); } wsscreen_detach_sync(sd->s_scr); - free(sd, M_DEVBUF); + free(sd, M_DEVBUF, 0); } int diff --git a/sys/dev/wscons/wsemul_dumb.c b/sys/dev/wscons/wsemul_dumb.c index 1226cb2cd72..9c5ed2a316d 100644 --- a/sys/dev/wscons/wsemul_dumb.c +++ b/sys/dev/wscons/wsemul_dumb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_dumb.c,v 1.11 2013/10/18 22:06:41 miod Exp $ */ +/* $OpenBSD: wsemul_dumb.c,v 1.12 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsemul_dumb.c,v 1.7 2000/01/05 11:19:36 drochner Exp $ */ /* @@ -299,7 +299,7 @@ wsemul_dumb_detach(void *cookie, u_int *crowp, u_int *ccolp) *crowp = edp->crow; *ccolp = edp->ccol; if (edp != &wsemul_dumb_console_emuldata) - free(edp, M_DEVBUF); + free(edp, M_DEVBUF, 0); } void diff --git a/sys/dev/wscons/wsemul_sun.c b/sys/dev/wscons/wsemul_sun.c index b698fd3c03f..6d79675a332 100644 --- a/sys/dev/wscons/wsemul_sun.c +++ b/sys/dev/wscons/wsemul_sun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_sun.c,v 1.30 2013/10/18 22:06:41 miod Exp $ */ +/* $OpenBSD: wsemul_sun.c,v 1.31 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsemul_sun.c,v 1.11 2000/01/05 11:19:36 drochner Exp $ */ /* @@ -1062,7 +1062,7 @@ wsemul_sun_detach(void *cookie, u_int *crowp, u_int *ccolp) *crowp = edp->crow; *ccolp = edp->ccol; if (edp != &wsemul_sun_console_emuldata) - free(edp, M_DEVBUF); + free(edp, M_DEVBUF, 0); } void diff --git a/sys/dev/wscons/wsemul_vt100.c b/sys/dev/wscons/wsemul_vt100.c index 20ec8b12d57..ab1df8d4e43 100644 --- a/sys/dev/wscons/wsemul_vt100.c +++ b/sys/dev/wscons/wsemul_vt100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsemul_vt100.c,v 1.31 2013/10/18 22:06:41 miod Exp $ */ +/* $OpenBSD: wsemul_vt100.c,v 1.32 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsemul_vt100.c,v 1.13 2000/04/28 21:56:16 mycroft Exp $ */ /* @@ -238,7 +238,7 @@ wsemul_vt100_detach(void *cookie, u_int *crowp, u_int *ccolp) *crowp = edp->crow; *ccolp = edp->ccol; -#define f(ptr) if (ptr) {free(ptr, M_DEVBUF); ptr = NULL;} +#define f(ptr) if (ptr) {free(ptr, M_DEVBUF, 0); ptr = NULL;} f(edp->tabs) f(edp->dblwid) f(edp->dcsarg) @@ -248,7 +248,7 @@ wsemul_vt100_detach(void *cookie, u_int *crowp, u_int *ccolp) f(edp->nrctab) #undef f if (edp != &wsemul_vt100_console_emuldata) - free(edp, M_DEVBUF); + free(edp, M_DEVBUF, 0); } void diff --git a/sys/dev/wscons/wsevent.c b/sys/dev/wscons/wsevent.c index 55a167db95a..9fd74cce859 100644 --- a/sys/dev/wscons/wsevent.c +++ b/sys/dev/wscons/wsevent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsevent.c,v 1.8 2012/12/05 23:20:22 deraadt Exp $ */ +/* $OpenBSD: wsevent.c,v 1.9 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsevent.c,v 1.16 2003/08/07 16:31:29 agc Exp $ */ /* @@ -117,7 +117,7 @@ wsevent_fini(struct wseventvar *ev) #endif return; } - free(ev->q, M_DEVBUF); + free(ev->q, M_DEVBUF, 0); ev->q = NULL; } diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index 7d2a7160a22..f5ccf1075a8 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbd.c,v 1.79 2014/07/11 08:18:31 guenther Exp $ */ +/* $OpenBSD: wskbd.c,v 1.80 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */ /* @@ -624,7 +624,7 @@ wskbd_detach(struct device *self, int flags) splx(s); } - free(sc->sc_map, M_DEVBUF); + free(sc->sc_map, M_DEVBUF, 0); /* locate the major number */ for (maj = 0; maj < nchrdev; maj++) @@ -1116,7 +1116,7 @@ getkeyrepeat: KB_HANDLEDBYWSKBD); wskbd_update_layout(sc->id, enc); } - free(buf, M_TEMP); + free(buf, M_TEMP, 0); return(error); case WSKBDIO_GETMAP: diff --git a/sys/dev/wscons/wskbdutil.c b/sys/dev/wscons/wskbdutil.c index 21c771f4e67..e0341bd54fb 100644 --- a/sys/dev/wscons/wskbdutil.c +++ b/sys/dev/wscons/wskbdutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wskbdutil.c,v 1.12 2014/05/15 09:29:38 mpi Exp $ */ +/* $OpenBSD: wskbdutil.c,v 1.13 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wskbdutil.c,v 1.7 1999/12/21 11:59:13 drochner Exp $ */ /*- @@ -379,7 +379,7 @@ wskbd_init_keymap(int newlen, struct wscons_keymap **map, int *maplen) if (newlen != *maplen) { if (*maplen > 0) - free(*map, M_DEVBUF); + free(*map, M_DEVBUF, 0); *maplen = newlen; *map = malloc(newlen*sizeof(struct wscons_keymap), M_DEVBUF, M_WAITOK); diff --git a/sys/dev/wscons/wsmux.c b/sys/dev/wscons/wsmux.c index 8e43a33c051..8546c0de920 100644 --- a/sys/dev/wscons/wsmux.c +++ b/sys/dev/wscons/wsmux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsmux.c,v 1.26 2014/01/26 17:48:08 miod Exp $ */ +/* $OpenBSD: wsmux.c,v 1.27 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */ /* @@ -146,7 +146,7 @@ wsmux_getmux(int n) wsmuxdevs = new; nwsmux = n + 1; if (old != NULL) - free(old, M_DEVBUF); + free(old, M_DEVBUF, 0); } sc = wsmuxdevs[n]; diff --git a/sys/dev/wsfont/wsfont.c b/sys/dev/wsfont/wsfont.c index 4720de12f64..78b38dabf51 100644 --- a/sys/dev/wsfont/wsfont.c +++ b/sys/dev/wsfont/wsfont.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsfont.c,v 1.35 2013/10/20 21:24:01 miod Exp $ */ +/* $OpenBSD: wsfont.c,v 1.36 2014/07/12 18:48:53 tedu Exp $ */ /* $NetBSD: wsfont.c,v 1.17 2001/02/07 13:59:24 ad Exp $ */ /*- @@ -337,8 +337,8 @@ wsfont_rotate_internal(struct wsdisplay_font *font) * If we seem to have rotated this font already, drop the * new one... */ - free(newbits, M_DEVBUF); - free(newfont, M_DEVBUF); + free(newbits, M_DEVBUF, 0); + free(newfont, M_DEVBUF, 0); newfont = NULL; } @@ -504,13 +504,13 @@ wsfont_remove(int cookie) /* Don't free statically allocated font data */ if ((ent->flg & WSFONT_STATIC) != 0) { - free(ent->font->data, M_DEVBUF); - free(ent->font, M_DEVBUF); + free(ent->font->data, M_DEVBUF, 0); + free(ent->font, M_DEVBUF, 0); } /* Remove from list, free entry */ TAILQ_REMOVE(&list, ent, chain); - free(ent, M_DEVBUF); + free(ent, M_DEVBUF, 0); splx(s); return (0); } -- 2.20.1