after discussions with beck deraadt kettenis.
-/* $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 <grange@openbsd.org>
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);
}
}
}
-/* $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 <john@scarfone.net>
*
}
onewire_reset(sc->sc_onewire);
- free(buf, M_DEVBUF);
+ free(buf, M_DEVBUF, 0);
done:
onewire_unlock(sc->sc_onewire);
-/* $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.
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);
}
(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);
}
{
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
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);
}
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);
}
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);
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);
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;
-/* $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 $ */
/*-
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);
}
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);
}
-/* $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
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);
*/
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);
}
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);
}
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);
}
-/* $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
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);
-/* $OpenBSD: arc.c,v 1.101 2014/02/08 16:02:42 chris Exp $ */
+/* $OpenBSD: arc.c,v 1.102 2014/07/12 18:48:51 tedu Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
ba->ba_status = sysinfo->alarm;
out:
- free(sysinfo, M_TEMP);
+ free(sysinfo, M_TEMP, 0);
return (error);
}
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);
}
}
out:
- free(sysinfo, M_TEMP);
+ free(sysinfo, M_TEMP, 0);
return (error);
}
}
out:
- free(volinfo, M_TEMP);
+ free(volinfo, M_TEMP, 0);
return (error);
}
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);
}
}
out:
- free(wbuf, M_TEMP);
- free(rbuf, M_TEMP);
+ free(wbuf, M_TEMP, 0);
+ free(rbuf, M_TEMP, 0);
return (error);
}
return;
bad:
- free(sc->sc_sensors, M_DEVBUF);
+ free(sc->sc_sensors, M_DEVBUF, 0);
}
void
destroy:
bus_dmamap_destroy(sc->sc_dmat, adm->adm_map);
admfree:
- free(adm, M_DEVBUF);
+ free(adm, M_DEVBUF, 0);
return (NULL);
}
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
arc_dmamem_free(sc, sc->sc_requests);
free_ccbs:
- free(sc->sc_ccbs, M_DEVBUF);
+ free(sc->sc_ccbs, M_DEVBUF, 0);
return (1);
}
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 *
-/* $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 $ */
/*-
error = auacer_allocmem(sc, size, PAGE_SIZE, p);
if (error) {
- free(p, pool);
+ free(p, pool, 0);
return (NULL);
}
if (KERNADDR(p) == ptr) {
auacer_freemem(sc, p);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
}
-/* $OpenBSD: auglx.c,v 1.11 2013/12/06 21:03:03 deraadt Exp $ */
+/* $OpenBSD: auglx.c,v 1.12 2014/07/12 18:48:51 tedu Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
error = auglx_allocmem(sc, size, PAGE_SIZE, p);
if (error) {
- free(p, pool);
+ free(p, pool, 0);
return NULL;
}
if (p->addr == ptr) {
auglx_freemem(sc, p);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
}
-/* $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
error = auich_allocmem(sc, size, PAGE_SIZE, p);
if (error) {
- free(p, pool);
+ free(p, pool, 0);
return NULL;
}
return;
auich_freemem(sc, p);
- free(p, pool);
+ free(p, pool, 0);
}
size_t
-/* $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 $ */
/*
/* 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;
SLIST_REMOVE(&sc->sc_dma_list, dma, auixp_dma,
dma_chain);
auixp_freemem(sc, dma);
- free(dma, pool);
+ free(dma, pool, 0);
return;
}
}
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;
}
-/* $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.
#endif
error = autri_allocmem(sc, size, 0x10000, p);
if (error) {
- free(p, pool);
+ free(p, pool, 0);
return NULL;
}
if (KERNADDR(p) == ptr) {
autri_freemem(sc, p);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
}
-/* $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 $ */
/*-
fail_map:
bus_dmamem_free(sc->sc_dmat, &p->seg, 1);
fail_alloc:
- free(p, pool);
+ free(p, pool, 0);
return 0;
}
bus_dmamem_free(sc->sc_dmat, &p->seg, 1);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
-/* $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 $ */
/*-
}
az->ncodecs = 0;
if (az->codecs != NULL) {
- free(az->codecs, M_DEVBUF);
+ free(az->codecs, M_DEVBUF, 0);
az->codecs = NULL;
}
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;
}
}
}
- free(convs, M_DEVBUF);
+ free(convs, M_DEVBUF, 0);
return(err);
}
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;
}
}
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);
}
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);
-/* $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 $ */
/*-
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;
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;
-/* $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 $ */
/*
bus_dmamem_free(n->cd_tag,
n->cd_segs, nitems(n->cd_segs));
mfree:
- free(n, type);
+ free(n, type, 0);
quit:
return error;
}
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;
}
}
-/* $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 $ */
/*
return (0);
p = malloc(sizeof(*p), pool, flags);
if (!p) {
- free(q,pool);
+ free(q,pool, 0);
return (0);
}
/*
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);
}
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;
}
}
-/* $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 $ */
/*
error = cs4281_allocmem(sc, size, pool, flags, p);
if (error) {
- free(p, pool);
+ free(p, pool, 0);
return (0);
}
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;
}
}
-/* $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
*/
static inline void
kfree(void *objp)
{
- free(objp, M_DRM);
+ free(objp, M_DRM, 0);
}
static inline void *
static inline void
vfree(void *objp)
{
- free(objp, M_DRM);
+ free(objp, M_DRM, 0);
}
#define min_t(t, a, b) ({ \
-/* $OpenBSD: drm_drv.c,v 1.128 2014/07/02 06:09:49 matthew Exp $ */
+/* $OpenBSD: drm_drv.c,v 1.129 2014/07/12 18:48:52 tedu Exp $ */
/*-
* Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org>
* Copyright © 2008 Intel Corporation
destroy:
bus_dmamap_destroy(dmat, mem->map);
strfree:
- free(mem, M_DRM);
+ free(mem, M_DRM, 0);
return (NULL);
}
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);
}
/**
-/* $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
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++) {
if (!new)
goto out;
bcopy(block, new, (valid_extensions + 1) * EDID_LENGTH);
- free(block, M_DRM);
+ free(block, M_DRM, 0);
block = new;
}
-/* $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
*
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
-/* $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.
return NULL;
if (oldpt && oldsize) {
memcpy(pt, oldpt, min(oldsize, size));
- free(oldpt, M_DRM);
+ free(oldpt, M_DRM, 0);
}
return pt;
}
drm_free(void *pt)
{
if (pt != NULL)
- free(pt, M_DRM);
+ free(pt, M_DRM, 0);
}
int
-/* $OpenBSD: i915_gem.c,v 1.73 2014/05/12 19:29:16 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.74 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
return PTR_ERR(page);
#else
err_pages:
- free(st, M_DRM);
+ free(st, M_DRM, 0);
return -ENOMEM;
#endif
}
-/* $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
*
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);
}
}
-/* $OpenBSD: i915_gem_execbuffer.c,v 1.28 2014/04/01 20:16:50 kettenis Exp $ */
+/* $OpenBSD: i915_gem_execbuffer.c,v 1.29 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
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)
-/* $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 -*-
*/
/*
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
}
-/* $OpenBSD: intel_hdmi.c,v 1.9 2014/01/23 10:42:57 jsg Exp $ */
+/* $OpenBSD: intel_hdmi.c,v 1.10 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright 2006 Dave Airlie <airlied@linux.ie>
* Copyright © 2006-2009 Intel Corporation
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) {
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;
{
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 = {
-/* $OpenBSD: intel_modes.c,v 1.4 2014/01/21 04:47:38 kettenis Exp $ */
+/* $OpenBSD: intel_modes.c,v 1.5 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
* Copyright (c) 2007, 2010 Intel Corporation
return 0;
ret = intel_connector_update_modes(connector, edid);
- free(edid, M_DRM);
+ free(edid, M_DRM, 0);
return ret;
}
-/* $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.
*
"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;
}
}
-/* $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.
"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;
}
-/* $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.
"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;
}
}
-/* $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.
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);
}
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;
}
-/* $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.
*
"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;
}
}
-/* $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 $ */
/*
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;
if (KERNADDR(p) == ptr) {
eap_freemem(sc, p);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
}
-/* $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 $ */
/*-
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 *
mem->segs = malloc(mem->nsegs * sizeof(*(mem->segs)), type, flags);
if (mem->segs == NULL) {
- free(mem, type);
+ free(mem, type, 0);
return (NULL);
}
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);
emuxki_mem_delete(struct emuxki_mem *mem, int type)
{
emuxki_dmamem_free(mem->dmamem, type);
- free(mem, type);
+ free(mem, type, 0);
}
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
if (lvoice) {
emuxki_voice_dataloc_destroy(lvoice);
- free(lvoice, M_DEVBUF);
+ free(lvoice, M_DEVBUF, 0);
}
}
-/* $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 $ */
/*
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);
if (KERNADDR(p) == addr) {
esa_freemem(sc, p);
*pp = p->next;
- free(p, type);
+ free(p, type, 0);
return;
}
}
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;
}
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);
}
-/* $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 $ */
/*
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;
if (KVADDR(p) == addr) {
eso_freemem(p);
*pp = p->ed_next;
- free(p, type);
+ free(p, type, 0);
return;
}
}
-/* $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 $ */
/*-
fail_map:
bus_dmamem_free(sc->sc_dmat, &p->seg, 1);
fail_alloc:
- free(p, pool);
+ free(p, pool, 0);
return 0;
}
bus_dmamem_free(sc->sc_dmat, &p->seg, 1);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
-/* $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
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++;
errout:
if (cmd != NULL) {
explicit_bzero(cmd, sizeof(*cmd));
- free(cmd, M_DEVBUF);
+ free(cmd, M_DEVBUF, 0);
}
if (err == EINVAL)
hifnstats.hst_invalid++;
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);
}
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);
}
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
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;
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);
}
-/* $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
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;
-/* $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
return (error);
if (size < sizeof(struct bnx_firmware_header)) {
- free(p, M_DEVBUF);
+ free(p, M_DEVBUF, 0);
return (EINVAL);
}
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;
}
return (error);
if (size < sizeof(struct bnx_rv2p_header)) {
- free(p, M_DEVBUF);
+ free(p, M_DEVBUF, 0);
return (EINVAL);
}
nswaph(rv2p->bnx_rv2p_proc2, hdr->bnx_rv2p_proc2len);
if (q - p != size) {
- free(p, M_DEVBUF);
+ free(p, M_DEVBUF, 0);
return EINVAL;
}
nvram_write_end:
if (align_start || align_end)
- free(buf, M_DEVBUF);
+ free(buf, M_DEVBUF, 0);
return (rc);
}
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.285 2014/07/08 05:35:18 dlg Exp $ */
+/* $OpenBSD: if_em.c,v 1.286 2014/07/12 18:48:51 tedu Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
}
}
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)
}
}
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)
-/* $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
return 0;
-fail: free(fw->data, M_DEVBUF);
+fail: free(fw->data, M_DEVBUF, 0);
return error;
}
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 */
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;
-/* $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
goto fail2;
}
- free(data, M_DEVBUF);
+ free(data, M_DEVBUF, 0);
sc->sc_flags |= IWI_FLAG_FW_INITED;
if ((error = iwi_config(sc)) != 0) {
return 0;
-fail2: free(data, M_DEVBUF);
+fail2: free(data, M_DEVBUF, 0);
fail1: iwi_stop(ifp, 0);
return error;
}
-/* $OpenBSD: if_iwn.c,v 1.131 2014/03/19 10:09:19 mpi Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.132 2014/07/12 18:48:51 tedu Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
/* 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",
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;
}
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;
}
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;
}
(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;
}
/* 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);
-/* $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 $ */
/******************************************************************************
ixgbe_free_receive_structures(sc);
err_out:
ixgbe_free_pci_resources(sc);
- free(sc->mta, M_DEVBUF);
+ free(sc->mta, M_DEVBUF, 0);
}
/*********************************************************************
ixgbe_free_transmit_structures(sc);
ixgbe_free_receive_structures(sc);
- free(sc->mta, M_DEVBUF);
+ free(sc->mta, M_DEVBUF, 0);
return (0);
}
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);
}
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;
}
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;
}
}
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.60 2013/11/26 09:50:33 mpi Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.61 2014/07/12 18:48:51 tedu Exp $ */
#include <dev/pci/if_ixgb.h>
}
}
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) {
}
}
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)
-/* $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
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);
}
}
-/* $OpenBSD: if_myx.c,v 1.60 2014/07/10 07:02:50 dlg Exp $ */
+/* $OpenBSD: if_myx.c,v 1.61 2014/07/12 18:48:51 tedu Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
ret = 0;
err:
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
return (ret);
}
-/* $OpenBSD: if_nxe.c,v 1.64 2013/11/21 19:08:14 gsoares Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.65 2014/07/12 18:48:51 tedu Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
rv = 0;
out:
- free(ni, M_TEMP);
+ free(ni, M_TEMP, 0);
return (rv);
}
rv = 0;
out:
- free(nu, M_TEMP);
+ free(nu, M_TEMP, 0);
return (rv);
}
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);
}
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
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 *
destroy:
bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map);
ndmfree:
- free(ndm, M_DEVBUF);
+ free(ndm, M_DEVBUF, 0);
return (NULL);
}
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
-/* $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
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);
}
1, 0, 3);
if (!cq) {
oce_destroy_ring(sc, wq->ring);
- free(wq, M_DEVBUF);
+ free(wq, M_DEVBUF, 0);
return (NULL);
}
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);
}
/**
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);
}
1, 0, 3);
if (!cq) {
oce_destroy_ring(sc, rq->ring);
- free(rq, M_DEVBUF);
+ free(rq, M_DEVBUF, 0);
return (NULL);
}
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 *
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);
}
if (oce_new_eq(sc, eq)) {
oce_destroy_ring(sc, eq->ring);
- free(eq, M_DEVBUF);
+ free(eq, M_DEVBUF, 0);
return (NULL);
}
}
if (eq->ring != NULL)
oce_destroy_ring(sc, eq->ring);
- free(eq, M_DEVBUF);
+ free(eq, M_DEVBUF, 0);
}
struct oce_mq *
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);
}
1, 0, 0);
if (!cq) {
oce_destroy_ring(sc, mq->ring);
- free(mq, M_DEVBUF);
+ free(mq, M_DEVBUF, 0);
return (NULL);
}
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);
}
oce_destroy_ring(sc, mq->ring);
if (mq->cq != NULL)
oce_destroy_cq(mq->cq);
- free(mq, M_DEVBUF);
+ free(mq, M_DEVBUF, 0);
}
/**
cq->ring = oce_create_ring(sc, nitems, isize, 4);
if (!cq->ring) {
- free(cq, M_DEVBUF);
+ free(cq, M_DEVBUF, 0);
return (NULL);
}
if (oce_new_cq(sc, cq)) {
oce_destroy_ring(sc, cq->ring);
- free(cq, M_DEVBUF);
+ free(cq, M_DEVBUF, 0);
return (NULL);
}
}
if (cq->ring != NULL)
oce_destroy_ring(sc, cq->ring);
- free(cq, M_DEVBUF);
+ free(cq, M_DEVBUF, 0);
}
/**
fail_1:
bus_dmamap_destroy(dma->tag, dma->map);
fail_0:
- free(ring, M_DEVBUF);
+ free(ring, M_DEVBUF, 0);
return (NULL);
}
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
-/* $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)
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");
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;
}
-/* $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)
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);
}
wanpipe_generic_unregister(ifp);
ifp->if_softc = NULL;
- free(sc, M_DEVBUF);
+ free(sc, M_DEVBUF, 0);
return (0);
}
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;
-/* $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)
return EBUSY;
}
LIST_REMOVE(tmp, next);
- free(tmp, M_DEVBUF);
+ free(tmp, M_DEVBUF, 0);
}
#endif
return (0);
return (EBUSY);
}
LIST_REMOVE(tmp_card, next);
- free(tmp_card, M_DEVBUF);
+ free(tmp_card, M_DEVBUF, 0);
return 0;
}
#endif
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);
}
-/* $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
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);
}
}
-/* $OpenBSD: if_tht.c,v 1.126 2013/04/02 13:43:40 brad Exp $ */
+/* $OpenBSD: if_tht.c,v 1.127 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
tht_write(sc, THT_REG_INIT_SEMAPHORE, 0x1);
err:
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
return (error);
}
destroy:
bus_dmamap_destroy(dmat, tdm->tdm_map);
tdmfree:
- free(tdm, M_DEVBUF);
+ free(tdm, M_DEVBUF, 0);
return (NULL);
}
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
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;
}
-/* $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
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);
}
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
err_mbuf:
m_freem(sd->sd_mbuf);
err_sd:
- free(sd, M_DEVBUF);
+ free(sd, M_DEVBUF, 0);
}
/*
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:
out:
if (rsp != NULL)
- free(rsp, M_DEVBUF);
+ free(rsp, M_DEVBUF, 0);
splx(s);
timeout_add_sec(&sc->sc_tick, 1);
*out2 = letoh32(rsp->rsp_par2);
if (out3 != NULL)
*out3 = letoh32(rsp->rsp_par3);
- free(rsp, M_DEVBUF);
+ free(rsp, M_DEVBUF, 0);
return (0);
}
out:
if (rsp != NULL)
- free(rsp, M_DEVBUF);
+ free(rsp, M_DEVBUF, 0);
}
-/* $OpenBSD: if_vic.c,v 1.79 2014/07/10 11:15:52 dlg Exp $ */
+/* $OpenBSD: if_vic.c,v 1.80 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
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);
}
-/* $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.
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:
-/* $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
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;
}
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. */
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;
}
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;
}
/* 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);
-/* $OpenBSD: ips.c,v 1.108 2011/07/17 22:46:48 matthew Exp $ */
+/* $OpenBSD: ips.c,v 1.109 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org>
}
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);
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);
}
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 *
-/* $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
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);
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;
}
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);
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;
}
/*
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);
}
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);
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);
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);
-/* $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)
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);
}
}
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);
}
}
break;
} else {
SIMPLEQ_REMOVE_HEAD(&sc->sc_queue, q_next);
- free(q, M_DEVBUF);
+ free(q, M_DEVBUF, 0);
}
}
}
-/* $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
void
salloc_destroy(salloc_t pool)
{
- free(pool, M_TEMP);
+ free(pool, M_TEMP, 0);
}
void
-/* $OpenBSD: mfii.c,v 1.15 2014/03/28 22:25:49 dlg Exp $ */
+/* $OpenBSD: mfii.c,v 1.16 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2012 David Gwynne <dlg@openbsd.org>
destroy:
bus_dmamap_destroy(sc->sc_dmat, m->mdm_map);
mdmfree:
- free(m, M_DEVBUF);
+ free(m, M_DEVBUF, 0);
return (NULL);
}
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);
}
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);
}
-/* $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
return;
free_devs:
- free(sc->sc_devs, M_DEVBUF);
+ free(sc->sc_devs, M_DEVBUF, 0);
sc->sc_devs = NULL;
free_queues:
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);
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++;
dev->expander = lemtoh16(&tcl->expander_handle);
if (mpii_insert_dev(sc, dev)) {
- free(dev, M_DEVBUF);
+ free(dev, M_DEVBUF, 0);
break;
}
DETACH_FORCE);
}
- free(dev, M_DEVBUF);
+ free(dev, M_DEVBUF, 0);
break;
}
}
destroy:
bus_dmamap_destroy(sc->sc_dmat, mdm->mdm_map);
mdmfree:
- free(mdm, M_DEVBUF);
+ free(mdm, M_DEVBUF, 0);
return (NULL);
}
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
mpii_dmamem_free(sc, sc->sc_requests);
free_ccbs:
- free(sc->sc_ccbs, M_DEVBUF);
+ free(sc->sc_ccbs, M_DEVBUF, 0);
return (1);
}
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);
}
scsi_io_put(&sc->sc_iopool, ccb);
done:
- free(vpg, M_TEMP);
+ free(vpg, M_TEMP, 0);
return (rv);
}
&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);
}
}
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);
}
strlcpy(bv->bv_dev, scdev->dv_xname, sizeof(bv->bv_dev));
}
- free(vpg, M_TEMP);
+ free(vpg, M_TEMP, 0);
return (0);
}
&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);
}
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));
}
bd->bd_diskid;
dn = pd->phys_disk_num;
- free(vpg, M_TEMP);
+ free(vpg, M_TEMP, 0);
return (mpii_bio_disk(sc, bd, dn));
}
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);
}
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++;
if (hscnt)
*hscnt = nhs;
- free(cpg, M_TEMP);
+ free(cpg, M_TEMP, 0);
return (0);
}
&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);
}
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);
}
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);
}
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);
}
break;
}
- free(vpg, M_TEMP);
+ free(vpg, M_TEMP, 0);
return (0);
}
return (0);
bad:
- free(sc->sc_sensors, M_DEVBUF);
+ free(sc->sc_sensors, M_DEVBUF, 0);
return (1);
}
-/* $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)
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);
}
}
break;
} else {
SIMPLEQ_REMOVE_HEAD(&sc->sc_pk_queue, q_next);
- free(q, M_DEVBUF);
+ free(q, M_DEVBUF, 0);
}
}
}
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);
}
}
-/* $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 $ */
/*
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;
}
}
TAILQ_REMOVE(head, chainp, wc_list);
- free(chainp, M_DEVBUF);
+ free(chainp, M_DEVBUF, 0);
return 0;
}
-/* $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 $ */
/*
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);
-/* $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 $ */
/*
pciide_unmapreg_dma(sc);
if (sc->sc_cookie)
- free(sc->sc_cookie, M_DEVBUF);
+ free(sc->sc_cookie, M_DEVBUF, 0);
}
void
-/* $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 $ */
/*
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);
-/* $OpenBSD: qle.c,v 1.29 2014/05/21 22:59:26 jmatthew Exp $ */
+/* $OpenBSD: qle.c,v 1.30 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
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);
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);
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)) {
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);
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;
}
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 "
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);
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",
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));
destroy:
bus_dmamap_destroy(sc->sc_dmat, m->qdm_map);
qdmfree:
- free(m, M_DEVBUF);
+ free(m, M_DEVBUF, 0);
return (NULL);
}
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
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);
}
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 *
-/* $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
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++;
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 */
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);
-/* $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
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;
if (KERNADDR(*p) == ptr) {
sv_freemem(sc, *p);
*p = (*p)->next;
- free(*p, pool);
+ free(*p, pool, 0);
return;
}
}
-/* $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)
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;
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++;
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: {
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:
}
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);
}
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);
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);
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;
}
-/* $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 $ */
/*
/* 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);
-/* $OpenBSD: vmwpvs.c,v 1.8 2013/10/30 02:11:32 dlg Exp $ */
+/* $OpenBSD: vmwpvs.c,v 1.9 2014/07/12 18:48:52 tedu Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
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:
destroy:
bus_dmamap_destroy(sc->sc_dmat, dm->dm_map);
dmfree:
- free(dm, M_DEVBUF);
+ free(dm, M_DEVBUF, 0);
return (NULL);
}
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);
}
-/* $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 $ */
/*
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;
}
yds_enable_dsp(sc);
delay(10*1000); /* neccesary on my 724F (??) */
- free(buf, M_DEVBUF);
+ free(buf, M_DEVBUF, 0);
return 0;
}
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;
}
}
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;
if (KERNADDR(p) == ptr) {
yds_freemem(sc, p);
*pp = p->next;
- free(p, pool);
+ free(p, pool, 0);
return;
}
}
-/* $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 $ */
/*-
}
if (synaptics_get_hwinfo(sc)) {
- free(sc->synaptics, M_DEVBUF);
+ free(sc->synaptics, M_DEVBUF, 0);
sc->synaptics = NULL;
goto err;
}
}
if (alps_get_hwinfo(sc)) {
- free(sc->alps, M_DEVBUF);
+ free(sc->alps, M_DEVBUF, 0);
sc->alps = NULL;
goto err;
}
}
if (elantech_get_hwinfo_v1(sc)) {
- free(sc->elantech, M_DEVBUF);
+ free(sc->elantech, M_DEVBUF, 0);
sc->elantech = NULL;
goto err;
}
}
if (elantech_get_hwinfo_v2(sc)) {
- free(sc->elantech, M_DEVBUF);
+ free(sc->elantech, M_DEVBUF, 0);
sc->elantech = NULL;
goto err;
}
}
if (elantech_get_hwinfo_v3(sc)) {
- free(sc->elantech, M_DEVBUF);
+ free(sc->elantech, M_DEVBUF, 0);
sc->elantech = NULL;
goto err;
}
}
if (elantech_get_hwinfo_v4(sc)) {
- free(sc->elantech, M_DEVBUF);
+ free(sc->elantech, M_DEVBUF, 0);
sc->elantech = NULL;
goto err;
}
-/* $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
/* 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;
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);
}
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
-/* $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 <mglocker@openbsd.org>
}
if (nr)
- free(nr, M_DEVBUF);
+ free(nr, M_DEVBUF, 0);
break;
default:
error = ieee80211_ioctl(ifp, cmd, data);
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;
}
}
/* 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);
-/* $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
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
-/* $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 $ */
/*
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);
-/* $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 $ */
/*
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);
-/* $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 $ */
/*-
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);
}
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
-/* $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 <matthew@dempsky.org>
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:
-/* $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.
if (myctx)
explicit_bzero(&lctx, sizeof(lctx));
explicit_bzero(buf, POOLBYTES);
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return ret;
}
arc4_init(NULL, NULL);
explicit_bzero(buf, POOLBYTES);
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return ret;
}
-/* $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)
fail1:
bus_dmamap_destroy(dmat, p->dmamap);
fail:
- free(p, pool);
+ free(p, pool, 0);
return (NULL);
}
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);
-/* $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.
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);
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);
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);
-/* $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
uio->uio_resid += (len - cnt);
}
- free(buffer, M_DEVBUF);
+ free(buffer, M_DEVBUF, 0);
return (error);
}
-/* $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
*
unmap:
bus_space_unmap(iot, ioh, sa->sa_size);
free:
- free(iot, M_DEVBUF);
+ free(iot, M_DEVBUF, 0);
}
-/* $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 <uwe@openbsd.org>
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);
-/* $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 <uwe@openbsd.org>
void
sdmmc_function_free(struct sdmmc_function *sf)
{
- free(sf, M_DEVBUF);
+ free(sf, M_DEVBUF, 0);
}
/*
return EFAULT;
if (ucmd->c_data)
- free(data, M_TEMP);
+ free(data, M_TEMP, 0);
break;
default:
-/* $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 <uwe@openbsd.org>
}
splx(s);
- free(ih, M_DEVBUF);
+ free(ih, M_DEVBUF, 0);
}
/*
-/* $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 <uwe@openbsd.org>
out:
if (ptr != NULL)
- free(ptr, M_DEVBUF);
+ free(ptr, M_DEVBUF, 0);
return error;
}
-/* $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 <uwe@openbsd.org>
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
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;
}
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;
}
}
-/* $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 <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
bzero(sd->sd_meta, SR_META_SIZE * 512);
- free(m, M_DEVBUF);
+ free(m, M_DEVBUF, 0);
rv = 0;
done:
return (rv);
wu.swu_dis = sd;
sd->sd_scsi_sync(&wu);
}
- free(m, M_DEVBUF);
+ free(m, M_DEVBUF, 0);
return (0);
bad:
return (1);
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),
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);
}
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);
}
rv = 0;
bad:
if (md)
- free(md, M_DEVBUF);
+ free(md, M_DEVBUF, 0);
return (rv);
}
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;
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 *
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);
}
}
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);
/* 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);
&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;
}
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;
}
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);
}
curproc);
vput(ch_entry->src_vn);
}
- free(ch_entry, M_DEVBUF);
+ free(ch_entry, M_DEVBUF, 0);
}
SLIST_INIT(cl);
}
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) {
}
explicit_bzero(sd, sizeof *sd);
- free(sd, M_DEVBUF);
+ free(sd, M_DEVBUF, 0);
}
void
uuidstr = sr_uuid_format(uuid);
printf("%s%s", uuidstr, (cr ? "\n" : ""));
- free(uuidstr, M_DEVBUF);
+ free(uuidstr, M_DEVBUF, 0);
}
int
-/* $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 <tedu@openbsd.org>
* Copyright (c) 2008 Marco Peereboom <marco@openbsd.org>
s = splnet();
TAILQ_REMOVE(&aoe_handlers, ah, next);
splx(s);
- free(ah, M_DEVBUF);
+ free(ah, M_DEVBUF, 0);
return rv;
}
#endif
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);
s = splbio();
TAILQ_REMOVE(&ah->reqs, ar, next);
splx(s);
- free(ar, M_DEVBUF);
+ free(ar, M_DEVBUF, 0);
return ENOMEM;
}
s = splbio();
TAILQ_REMOVE(&ah->reqs, ar, next);
splx(s);
- free(ar, M_DEVBUF);
+ free(ar, M_DEVBUF, 0);
}
return rv;
}
splx(s);
- free(ar, M_DEVBUF);
+ free(ar, M_DEVBUF, 0);
}
void
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);
-/* $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 <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
rv = 0;
out:
explicit_bzero(kdfinfo, bc->bc_opaque_size);
- free(kdfinfo, M_DEVBUF);
+ free(kdfinfo, M_DEVBUF, 0);
return (rv);
}
out:
if (p) {
explicit_bzero(p, ksz);
- free(p, M_DEVBUF);
+ free(p, M_DEVBUF, 0);
}
explicit_bzero(check_digest, sizeof(check_digest));
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);
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);
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);
-/* $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 <marco@peereboom.us>
* Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org>
/* 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;
}
-/* $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 <provos@citi.umich.edu>
* All rights reserved.
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);
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;
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;
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);
}
return (ret);
if (strp->replace != NULL) {
- free(strp->replace, M_XDATA);
+ free(strp->replace, M_XDATA, 0);
strp->replace = NULL;
}
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);
}
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) {
fst->npolicies--;
if (policy->nsysent)
- free(policy->sysent, M_XDATA);
+ free(policy->sysent, M_XDATA, 0);
TAILQ_REMOVE(&fst->policies, policy, next);
-/* $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.
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
-/* $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 $ */
/*
return (error);
err = ezload_download(dev, *names, buf, buflen);
- free(buf, M_DEVBUF);
+ free(buf, M_DEVBUF, 0);
if (err)
return (err);
names++;
-/* $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 $ */
if (s == NULL)
return;
- free(s, M_TEMP);
+ free(s, M_TEMP, 0);
}
static uint8_t
-/* $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 $ */
/*
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);
}
-/* $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 <damien.bergamini@free.fr>
usbd_close_pipe(usc->rx_intr_pipe);
}
if (usc->ibuf != NULL)
- free(usc->ibuf, M_USBDEV);
+ free(usc->ibuf, M_USBDEV, 0);
}
int
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)
-/* $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 <Danovitsch@Vitsch.net>. All rights reserved.
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 */
if (err) {
DPRINTF(("%s: dfu_dnload failed\n",
sc->atu_dev.dv_xname));
- free(firm, M_DEVBUF);
+ free(firm, M_DEVBUF, 0);
goto fail;
}
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",
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;
}
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);
-/* $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
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);
}
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);
}
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);
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;
}
-/* $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 <damien.bergamini@free.fr>
ptr += mlen;
size -= mlen;
}
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
return error;
}
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)
-/* $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 <damien.bergamini@free.fr>
goto fail;
}
fail:
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
return (error);
}
-/* $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 <damien.bergamini@free.fr>
sc->sc_dev.dv_xname);
}
- free(ucode, M_DEVBUF);
+ free(ucode, M_DEVBUF, 0);
}
void
-/* $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 <damien.bergamini@free.fr>
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);
-/* $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
}
error = uath_loadfirmware(sc, fw, size);
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
if (error == 0) {
usb_port_status_t status;
-/* $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 <mglocker@openbsd.org>
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);
}
-/* $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 <armani@openbsd.org>
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;
}
DEVNAME(sc),
letoh32(hdr->rm_len),
RNDIS_RESPONSE_LEN);
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return NULL;
}
rval = RNDIS_STATUS_FAILURE;
}
- free(hdr, M_TEMP);
+ free(hdr, M_TEMP, 0);
return rval;
}
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));
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));
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));
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));
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);
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));
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));
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;
}
-/* $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 <damien.bergamini@free.fr>
goto fail;
}
fail:
- free(fw, M_DEVBUF);
+ free(fw, M_DEVBUF, 0);
return (error);
}
-/* $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.
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;
}
/* 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;
}
-/* $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 <damien.bergamini@free.fr>
}
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);
}
}
if (sc->ibuf != NULL) {
- free(sc->ibuf, M_USBDEV);
+ free(sc->ibuf, M_USBDEV, 0);
sc->ibuf = NULL;
}
}
-/* $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 $ */
/*
/* 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;
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;
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;
}
/* 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",
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) {
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
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);
}
-/* $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 <jcs@openbsd.org>
}
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;
}
}
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);
}
-/* $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 <kan.FreeBSD.org>.
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;
}
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;
}
}
-/* $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 $ */
/*
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;
}
}
-/* $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 $ */
/*
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);
-/* $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 <mglocker@openbsd.org>
/* 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--;
}
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));
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;
}
}
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;
-/* $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 $ */
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);
}
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) {
}
if (sce->ibuf != NULL) {
- free(sce->ibuf, M_USBDEV);
+ free(sce->ibuf, M_USBDEV, 0);
sce->ibuf = NULL;
}
}
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 =
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;
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;
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:
{
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:
}
ret:
if (ptr)
- free(ptr, M_TEMP);
+ free(ptr, M_TEMP, 0);
return (error);
}
case USB_GET_DEVICEINFO:
-/* $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 $ */
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 */
}
}
splx(s);
- free(iso->stds, M_USBHC);
+ free(iso->stds, M_USBHC, 0);
}
usbd_status
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);
}
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;
-/* $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 $ */
/*
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);
-/* $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 $ */
/*
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;
}
}
}
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
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;
}
if (sc->sc_ibuf != NULL) {
- free(sc->sc_ibuf, M_USBDEV);
+ free(sc->sc_ibuf, M_USBDEV, 0);
sc->sc_ibuf = NULL;
}
}
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;
}
* 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;
}
-/* $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 $ */
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;
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;
}
}
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);
-/* $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 $ */
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);
}
-/* $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 $ */
/*
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;
}
-/* $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.
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;
}
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;
}
}
-/* $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.
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;
}
for (i=0; i<sc->sc_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;
}
return USBD_NORMAL_COMPLETION;
error:
- free(sc->sc_endpoints, M_USBDEV);
+ free(sc->sc_endpoints, M_USBDEV, 0);
sc->sc_endpoints = NULL;
return err;
}
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);
{
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
-/* $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 <yuo@nui.org>
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;
}
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;
}
}
-/* $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 <yuo@nui.org>
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;
}
-/* $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 <yuo@nui.org>
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;
}
-/* $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 <yuo@nui.org>
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;
}
-/* $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 <andre@openbsd.org>
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);
}
-/* $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.
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;
}
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;
}
}
-/* $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 $ */
/*
ret:
if (ptr != NULL)
- free(ptr, M_TEMP);
+ free(ptr, M_TEMP, 0);
return (error);
}
-/* $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 $ */
/*
if (cdesc == NULL)
return;
udc->udc_desc = *cdesc;
- free(cdesc, M_TEMP);
+ free(cdesc, M_TEMP, 0);
}
void
}
ret:
if (ptr)
- free(ptr, M_TEMP);
+ free(ptr, M_TEMP, 0);
return (error);
}
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);
}
-/* $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 $ */
/*
free1:
bus_dmamem_free(tag, p->segs, p->nsegs);
free0:
- free(p, M_USB);
+ free(p, M_USB, 0);
return (USBD_NOMEM);
}
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
-/* $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 $ */
bad:
if (ifc->endpoints != NULL) {
- free(ifc->endpoints, M_USB);
+ free(ifc->endpoints, M_USB, 0);
ifc->endpoints = NULL;
}
return (USBD_INVAL);
{
struct usbd_interface *ifc = &dev->ifaces[ifcno];
if (ifc->endpoints)
- free(ifc->endpoints, M_USB);
+ free(ifc->endpoints, M_USB, 0);
}
usbd_status
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;
return (USBD_NORMAL_COMPLETION);
bad:
- free(cdp, M_USB);
+ free(cdp, M_USB, 0);
return (err);
}
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;
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;
}
usbd_claim_iface(dev, i);
}
}
- free(ifaces, M_USB);
+ free(ifaces, M_USB, 0);
if (dev->ndevs > 0) {
for (i = 0; i < nifaces; i++) {
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. */
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);
if (!pnp)
printf(" %s\n", devinfop);
- free(devinfop, M_TEMP);
+ free(devinfop, M_TEMP, 0);
return (UNCONF);
}
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);
}
}
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);
}
/*
-/* $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 $ */
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);
}
/* 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) {
-/* $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 <uwe@openbsd.org>
if (newsize == 0) {
if (*sizep > 0)
- free(*pp, M_USB);
+ free(*pp, M_USB, 0);
*pp = NULL;
*sizep = 0;
return NULL;
#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;
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
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;
}
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;
}
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;
}
usbf_devinfo_free(char *devinfo)
{
if (devinfo != NULL)
- free(devinfo, M_USB);
+ free(devinfo, M_USB, 0);
}
/*
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;
}
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;
}
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;
}
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) {
if (err)
break;
- free(ue->edesc, M_USB);
+ free(ue->edesc, M_USB, 0);
ue->edesc = (usb_endpoint_descriptor_t *)d;
}
}
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;
usbf_abort_pipe(pipe);
pipe->methods->close(pipe);
pipe->endpoint->refcnt--;
- free(pipe, M_USB);
+ free(pipe, M_USB, 0);
}
void
-/* $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 <yuo@nui.org>
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
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)
-/* $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 <dxi@mail.ru>.
*
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;
}
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;
}
}
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;
}
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;
}
-/* $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 <yuo@nui.org>
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;
}
-/* $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 <robert@openbsd.org>
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);
}
}
if (sc->sc_ibuf != NULL) {
- free(sc->sc_ibuf, M_USBDEV);
+ free(sc->sc_ibuf, M_USBDEV, 0);
sc->sc_ibuf = NULL;
}
-/* $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 <yuo@nui.org>
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;
}
-/* $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 <robert@openbsd.org>
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;
}
qctrl->flags = 0;
out:
- free(ctrl_data, M_USBDEV);
+ free(ctrl_data, M_USBDEV, 0);
return (ret);
}
}
out:
- free(ctrl_data, M_USBDEV);
+ free(ctrl_data, M_USBDEV, 0);
return (0);
}
if (error != USBD_NORMAL_COMPLETION)
ret = EINVAL;
- free(ctrl_data, M_USBDEV);
+ free(ctrl_data, M_USBDEV, 0);
return (ret);
}
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);
}
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",
offset += len;
remain -= len;
}
- free(ucode, M_DEVBUF);
+ free(ucode, M_DEVBUF, 0);
/* activate microcode */
cbuf = 0;
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;
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;
-/* $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 <akiyama@jp.FreeBSD.org>.
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;
}
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;
}
}
-/* $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 <robert@openbsd.org>
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++)
-/* $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 <david@zentus.com>
return;
free:
- free(sc->sc_rpc_buf, M_DEVBUF);
+ free(sc->sc_rpc_buf, M_DEVBUF, 0);
}
int
-/* $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 $ */
/*
/* 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. */
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:
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);
}
-/* $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 <dlg@openbsd.org>
gone:
device_unref(&sc->sc_dev);
- free(dt, M_TEMP);
+ free(dt, M_TEMP, 0);
}
int
-/* $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 $ */
/*
fail:
if (dconf != NULL)
- free(dconf, M_DEVBUF);
- free(scr, M_DEVBUF);
+ free(dconf, M_DEVBUF, 0);
+ free(scr, M_DEVBUF, 0);
return (NULL);
}
}
(*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 *
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:
}
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) {
-/* $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 $ */
/*
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;
(*sd->s_callback)(sd->s_cbarg, ENXIO, 0);
}
wsscreen_detach_sync(sd->s_scr);
- free(sd, M_DEVBUF);
+ free(sd, M_DEVBUF, 0);
}
int
-/* $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 $ */
/*
*crowp = edp->crow;
*ccolp = edp->ccol;
if (edp != &wsemul_dumb_console_emuldata)
- free(edp, M_DEVBUF);
+ free(edp, M_DEVBUF, 0);
}
void
-/* $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 $ */
/*
*crowp = edp->crow;
*ccolp = edp->ccol;
if (edp != &wsemul_sun_console_emuldata)
- free(edp, M_DEVBUF);
+ free(edp, M_DEVBUF, 0);
}
void
-/* $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 $ */
/*
*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)
f(edp->nrctab)
#undef f
if (edp != &wsemul_vt100_console_emuldata)
- free(edp, M_DEVBUF);
+ free(edp, M_DEVBUF, 0);
}
void
-/* $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 $ */
/*
#endif
return;
}
- free(ev->q, M_DEVBUF);
+ free(ev->q, M_DEVBUF, 0);
ev->q = NULL;
}
-/* $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 $ */
/*
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++)
KB_HANDLEDBYWSKBD);
wskbd_update_layout(sc->id, enc);
}
- free(buf, M_TEMP);
+ free(buf, M_TEMP, 0);
return(error);
case WSKBDIO_GETMAP:
-/* $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 $ */
/*-
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);
-/* $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 $ */
/*
wsmuxdevs = new;
nwsmux = n + 1;
if (old != NULL)
- free(old, M_DEVBUF);
+ free(old, M_DEVBUF, 0);
}
sc = wsmuxdevs[n];
-/* $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 $ */
/*-
* 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;
}
/* 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);
}