From: tedu Date: Sat, 12 Jul 2014 18:48:17 +0000 (+0000) Subject: add a size argument to free. will be used soon, but for now default to 0. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aa3cabd09e6b42375ee0b2752abfd9b6628d36bd;p=openbsd add a size argument to free. will be used soon, but for now default to 0. after discussions with beck deraadt kettenis. --- diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b680f28487b..c5c920fefbc 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.264 2014/07/12 09:02:24 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.265 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -512,13 +512,13 @@ acpi_getpci(struct aml_node *node, void *arg) /* Check if PCI device exists */ if (pci->dev > 0x1F || pci->fun > 7) { - free(pci, M_DEVBUF); + free(pci, M_DEVBUF, 0); return (1); } tag = pci_make_tag(pc, pci->bus, pci->dev, pci->fun); reg = pci_conf_read(pc, tag, PCI_ID_REG); if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID) { - free(pci, M_DEVBUF); + free(pci, M_DEVBUF, 0); return (1); } node->pci = pci; @@ -1069,7 +1069,7 @@ acpi_loadtables(struct acpi_softc *sc, struct acpi_rsdp *rsdp) acpi_maptable(sc, xsdt->table_offsets[i], NULL, NULL, NULL, 1); - free(sdt, M_DEVBUF); + free(sdt, M_DEVBUF, 0); } else { struct acpi_rsdt *rsdt; @@ -1088,7 +1088,7 @@ acpi_loadtables(struct acpi_softc *sc, struct acpi_rsdp *rsdp) acpi_maptable(sc, rsdt->table_offsets[i], NULL, NULL, NULL, 1); - free(sdt, M_DEVBUF); + free(sdt, M_DEVBUF, 0); } return (0); @@ -1418,7 +1418,7 @@ acpi_dotask(struct acpi_softc *sc) wq->handler(wq->arg0, wq->arg1); - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); /* We did something */ return (1); @@ -1893,7 +1893,7 @@ acpi_foundprw(struct aml_node *node, void *arg) wq->q_wakepkg = malloc(sizeof(struct aml_value), M_DEVBUF, M_NOWAIT | M_ZERO); if (wq->q_wakepkg == NULL) { - free(wq, M_DEVBUF); + free(wq, M_DEVBUF, 0); return 0; } dnprintf(10, "Found _PRW (%s)\n", node->parent->name); @@ -2310,7 +2310,7 @@ acpi_thread(void *arg) while(acpi_dotask(acpi_softc)) ; } - free(thread, M_DEVBUF); + free(thread, M_DEVBUF, 0); kthread_exit(0); } diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index abd7ed78fa6..56eae560a76 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.59 2014/07/11 14:33:45 kettenis Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.60 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -606,7 +606,7 @@ acpicpu_getpss(struct acpicpu_softc *sc) } if (sc->sc_pss) - free(sc->sc_pss, M_DEVBUF); + free(sc->sc_pss, M_DEVBUF, 0); sc->sc_pss = malloc(res.length * sizeof *sc->sc_pss, M_DEVBUF, M_WAITOK | M_ZERO); diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c index fb879305f7e..c285986c09c 100644 --- a/sys/dev/acpi/acpimadt.c +++ b/sys/dev/acpi/acpimadt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpimadt.c,v 1.28 2014/07/06 21:36:55 kettenis Exp $ */ +/* $OpenBSD: acpimadt.c,v 1.29 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 Mark Kettenis * @@ -330,7 +330,7 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) if (!acpimadt_cfg_intr(entry->madt_override.flags, &map->redir)) { printf("%s: bogus override for pin %d\n", self->dv_xname, pin); - free(map, M_DEVBUF); + free(map, M_DEVBUF, 0); break; } diff --git a/sys/dev/acpi/atk0110.c b/sys/dev/acpi/atk0110.c index ef9aec19385..e8cc6533fb4 100644 --- a/sys/dev/acpi/atk0110.c +++ b/sys/dev/acpi/atk0110.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atk0110.c,v 1.9 2014/05/21 02:14:07 mlarkin Exp $ */ +/* $OpenBSD: atk0110.c,v 1.10 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2009 Constantine A. Murenin @@ -330,7 +330,7 @@ aibs_add_sensor(struct aibs_softc *sc, char *name) printf("%s: aibs_add_sensor: %s: unknown sensor type %llx\n", DEVNAME(sc), name, ri.v_package[0]->v_integer); aml_freevalue(&ri); - free(as, M_DEVBUF); + free(as, M_DEVBUF, 0); return; } strlcpy(as->s.desc, ri.v_package[1]->v_string, diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 6f187c5b078..89179f9fae6 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.211 2014/06/25 18:56:22 kettenis Exp $ */ +/* $OpenBSD: dsdt.c,v 1.212 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -452,7 +452,7 @@ _acpi_os_free(void *ptr, const char *fn, int line) #endif dnprintf(99, "free: %p %s:%d\n", sptr, fn, line); - free(sptr, M_ACPI); + free(sptr, M_ACPI, 0); } } diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 6c6ba32bdd5..bd75eece59f 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.118 2013/12/09 11:44:52 dlg Exp $ */ +/* $OpenBSD: atascsi.c,v 1.119 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -216,8 +216,8 @@ atascsi_detach(struct atascsi *as, int flags) if (rv != 0) return (rv); - free(as->as_host_ports, M_DEVBUF); - free(as, M_DEVBUF); + free(as->as_host_ports, M_DEVBUF, 0); + free(as, M_DEVBUF, 0); return (0); } @@ -437,7 +437,7 @@ atascsi_probe(struct scsi_link *link) return (0); error: - free(ap, M_DEVBUF); + free(ap, M_DEVBUF, 0); unsupported: as->as_methods->free(as->as_cookie, port, link->lun); @@ -464,7 +464,7 @@ atascsi_free(struct scsi_link *link) return; ap = ahp->ahp_ports[link->lun]; - free(ap, M_DEVBUF); + free(ap, M_DEVBUF, 0); ahp->ahp_ports[link->lun] = NULL; as->as_methods->free(as->as_cookie, port, link->lun); @@ -474,7 +474,7 @@ atascsi_free(struct scsi_link *link) * free ahp itself. this relies on the order luns are * detached in scsi_detach_target(). */ - free(ahp, M_DEVBUF); + free(ahp, M_DEVBUF, 0); as->as_host_ports[port] = NULL; } } diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 04ccdc8d872..3b0c33b0cec 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.115 2014/07/10 14:21:20 deraadt Exp $ */ +/* $OpenBSD: wd.c,v 1.116 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */ /* @@ -781,7 +781,7 @@ wdioctl(dev_t dev, u_long xfer, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); wdgetdisklabel(dev, wd, lp, 0); bcopy(lp, wd->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); goto exit; case DIOCGPDINFO: diff --git a/sys/dev/audio.c b/sys/dev/audio.c index f29f69af426..a9fa22b6496 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.121 2014/05/19 07:00:15 ratchov Exp $ */ +/* $OpenBSD: audio.c,v 1.122 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -715,7 +715,7 @@ audio_free_ring(struct audio_softc *sc, struct audio_ringbuffer *r) if (sc->hw_if->freem) { sc->hw_if->freem(sc->hw_hdl, r->start, M_DEVBUF); } else { - free(r->start, M_DEVBUF); + free(r->start, M_DEVBUF, 0); } } @@ -3269,7 +3269,7 @@ mixer_remove(struct audio_softc *sc, struct proc *p) if ((*pm)->proc == p) { m = *pm; *pm = m->next; - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return; } } diff --git a/sys/dev/bio.c b/sys/dev/bio.c index 9fa89ddfd7c..42956d5820b 100644 --- a/sys/dev/bio.c +++ b/sys/dev/bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.c,v 1.14 2012/01/20 12:38:20 jsing Exp $ */ +/* $OpenBSD: bio.c,v 1.15 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2002 Niklas Hallqvist. All rights reserved. @@ -134,7 +134,7 @@ bio_unregister(struct device *dev) if (dev == bm->bm_dev) { LIST_REMOVE(bm, bm_link); - free(bm, M_DEVBUF); + free(bm, M_DEVBUF, 0); } } } diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 4e8d4d814e8..3534040a5ac 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.46 2013/05/30 16:15:01 deraadt Exp $ */ +/* $OpenBSD: cardbus.c,v 1.47 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -241,7 +241,7 @@ cardbus_read_tuples(struct cardbus_attach_args *ca, pcireg_t cis_ptr, out: while ((p = SIMPLEQ_FIRST(&rom_image)) != NULL) { SIMPLEQ_REMOVE_HEAD(&rom_image, next); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } exrom = pci_conf_read(pc, tag, reg); pci_conf_write(pc, tag, reg, exrom & ~1); @@ -537,7 +537,7 @@ cardbus_attach_card(struct cardbus_softc *sc) cardbussubmatch)) == NULL) { /* do not match */ disable_function(sc, function); - free(ct, M_DEVBUF); + free(ct, M_DEVBUF, 0); *previous_next = NULL; } else { /* found */ @@ -551,7 +551,7 @@ cardbus_attach_card(struct cardbus_softc *sc) * if no functions were attached). */ disable_function(sc, 8); - free(tuple, M_TEMP); + free(tuple, M_TEMP, 0); return (no_work_funcs); } @@ -625,7 +625,7 @@ cardbus_detach_card(struct cardbus_softc *sc) } else { sc->sc_poweron_func &= ~(1 << ct->ct_func); *prev_next = ct->ct_next; - free(ct, M_DEVBUF); + free(ct, M_DEVBUF, 0); } } diff --git a/sys/dev/cardbus/cardbus_exrom.c b/sys/dev/cardbus/cardbus_exrom.c index 41402f31078..ee1b27ea952 100644 --- a/sys/dev/cardbus/cardbus_exrom.c +++ b/sys/dev/cardbus/cardbus_exrom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus_exrom.c,v 1.5 2013/06/20 09:52:09 mpi Exp $ */ +/* $OpenBSD: cardbus_exrom.c,v 1.6 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: cardbus_exrom.c,v 1.4 2000/02/03 06:47:31 thorpej Exp $ */ /* @@ -139,7 +139,7 @@ cardbus_read_exrom(bus_space_tag_t romt, bus_space_handle_t romh, if (bus_space_subregion(romt, romh, addr, image_size, &image->romh)) { DPRINTF(("%s: bus_space_subregion failed", __func__)); - free(image, M_DEVBUF); + free(image, M_DEVBUF, 0); return (1); } SIMPLEQ_INSERT_TAIL(head, image, next); diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index 8cd3182a342..124f28d0e5d 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.7 2012/04/22 05:43:14 guenther Exp $ */ +/* $OpenBSD: diskmap.c,v 1.8 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing @@ -118,7 +118,7 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) FRELE(fp, p); fdpunlock(fdp); - free(devname, M_DEVBUF); + free(devname, M_DEVBUF, 0); return 0; @@ -131,7 +131,7 @@ bad: fdpunlock(fdp); invalid: - free(devname, M_DEVBUF); + free(devname, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/firmload.c b/sys/dev/firmload.c index 4c150f368ce..936af9fcfc7 100644 --- a/sys/dev/firmload.c +++ b/sys/dev/firmload.c @@ -1,4 +1,4 @@ -/* $OpenBSD: firmload.c,v 1.10 2011/03/23 16:09:19 marco Exp $ */ +/* $OpenBSD: firmload.c,v 1.11 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -102,12 +102,12 @@ loadfirmware(const char *name, u_char **bufp, size_t *buflen) *bufp = ptr; *buflen = va.va_size; } else - free(ptr, M_DEVBUF); + free(ptr, M_DEVBUF, 0); fail: vput(nid.ni_vp); err: if (path) - free(path, M_TEMP); + free(path, M_TEMP, 0); return (error); } diff --git a/sys/dev/gpio/gpio.c b/sys/dev/gpio/gpio.c index 0bca78d5c6b..7ccf7346810 100644 --- a/sys/dev/gpio/gpio.c +++ b/sys/dev/gpio/gpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpio.c,v 1.12 2011/10/03 20:24:51 matthieu Exp $ */ +/* $OpenBSD: gpio.c,v 1.13 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2008 Marc Balmer @@ -427,7 +427,7 @@ gpioioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) == 0) { if (config_detach(gdev->sc_dev, 0) == 0) { LIST_REMOVE(gdev, sc_next); - free(gdev, M_DEVBUF); + free(gdev, M_DEVBUF, 0); } break; } @@ -504,7 +504,7 @@ gpioioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) LIST_FOREACH(nm, &sc->sc_names, gp_next) { if (nm->gp_pin == pin) { LIST_REMOVE(nm, gp_next); - free(nm, M_DEVBUF); + free(nm, M_DEVBUF, 0); break; } } diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index d59dfd0176b..37dcde32940 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.63 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: aac.c,v 1.64 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -470,7 +470,7 @@ aac_free(struct aac_softc *sc) if (sc->aac_fib_dmat) bus_dma_tag_destroy(sc->aac_fib_dmat); - free(sc->aac_commands, M_AACBUF); + free(sc->aac_commands, M_AACBUF, 0); /* destroy the common area */ if (sc->aac_common) { @@ -526,7 +526,7 @@ aac_detach(device_t dev) if (error) return (error); TAILQ_REMOVE(&sc->aac_container_tqh, co, co_link); - free(co, M_AACBUF); + free(co, M_AACBUF, 0); } /* Remove the CAM SIMs */ @@ -535,7 +535,7 @@ aac_detach(device_t dev) error = device_delete_child(dev, sim->sim_dev); if (error) return (error); - free(sim, M_AACBUF); + free(sim, M_AACBUF, 0); } if (sc->aifflags & AAC_AIFFLAGS_RUNNING) { @@ -1267,7 +1267,7 @@ aac_alloc_commands(struct aac_softc *sc) exit_map: bus_dmamem_free(sc->aac_dmat, &fm->aac_seg, fm->aac_nsegs); exit_alloc: - free(fm, M_DEVBUF); + free(fm, M_DEVBUF, 0); exit: AAC_LOCK_RELEASE(&sc->aac_io_lock); return (error); @@ -1301,7 +1301,7 @@ aac_free_commands(struct aac_softc *sc) bus_dmamem_unmap(sc->aac_dmat, (caddr_t)fm->aac_fibs, AAC_FIBMAP_SIZE); bus_dmamem_free(sc->aac_dmat, &fm->aac_seg, fm->aac_nsegs); - free(fm, M_DEVBUF); + free(fm, M_DEVBUF, 0); } } diff --git a/sys/dev/ic/ac97.c b/sys/dev/ic/ac97.c index a3f81f9144c..27d4ece9585 100644 --- a/sys/dev/ic/ac97.c +++ b/sys/dev/ic/ac97.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ac97.c,v 1.77 2011/01/03 15:28:46 fgsch Exp $ */ +/* $OpenBSD: ac97.c,v 1.78 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 1999, 2000 Constantine Sapuntzakis @@ -818,7 +818,7 @@ ac97_attach(struct ac97_host_if *host_if) as->host_if = host_if; if ((error = host_if->attach(host_if->arg, &as->codec_if))) { - free(as, M_DEVBUF); + free(as, M_DEVBUF, 0); return (error); } diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c index 96b0cbcd9a3..4103e850fa6 100644 --- a/sys/dev/ic/acx.c +++ b/sys/dev/ic/acx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acx.c,v 1.102 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: acx.c,v 1.103 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -1560,7 +1560,7 @@ acx_load_base_firmware(struct acx_softc *sc, const char *name) /* Load base firmware */ error = acx_load_firmware(sc, 0, ucode, size); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); if (error) { printf("%s: can't load base firmware\n", ifp->if_xname); @@ -1611,21 +1611,21 @@ acx_load_radio_firmware(struct acx_softc *sc, const char *name) * radio firmware can be loaded after it. */ if (acx_get_conf(sc, ACX_CONF_MMAP, &mem_map, sizeof(mem_map)) != 0) { - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (ENXIO); } radio_fw_ofs = letoh32(mem_map.code_end); /* Put ECPU into sleeping state, before loading radio firmware */ if (acx_exec_command(sc, ACXCMD_SLEEP, NULL, 0, NULL, 0) != 0) { - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (ENXIO); } /* Load radio firmware */ error = acx_load_firmware(sc, radio_fw_ofs, ucode, size); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); if (error) { printf("%s: can't load radio firmware\n", ifp->if_xname); diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index 2725e6220fe..669ae5f0962 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.14 2014/06/26 04:25:38 jmatthew Exp $ */ +/* $OpenBSD: ahci.c,v 1.15 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -673,7 +673,7 @@ ahci_port_free(struct ahci_softc *sc, u_int port) if (ap->ap_ccbs) { while ((ccb = ahci_get_ccb(ap)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); - free(ap->ap_ccbs, M_DEVBUF); + free(ap->ap_ccbs, M_DEVBUF, 0); } if (ap->ap_dmamem_cmd_list) @@ -687,7 +687,7 @@ ahci_port_free(struct ahci_softc *sc, u_int port) /* bus_space(9) says we dont free the subregions handle */ - free(ap, M_DEVBUF); + free(ap, M_DEVBUF, 0); sc->sc_ports[port] = NULL; } @@ -2598,7 +2598,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, adm->adm_map); admfree: - free(adm, M_DEVBUF); + free(adm, M_DEVBUF, 0); return (NULL); } @@ -2610,7 +2610,7 @@ ahci_dmamem_free(struct ahci_softc *sc, struct ahci_dmamem *adm) bus_dmamem_unmap(sc->sc_dmat, adm->adm_kva, adm->adm_size); bus_dmamem_free(sc->sc_dmat, &adm->adm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, adm->adm_map); - free(adm, M_DEVBUF); + free(adm, M_DEVBUF, 0); } u_int32_t diff --git a/sys/dev/ic/aic79xx.c b/sys/dev/ic/aic79xx.c index f20ce6ee5dc..6fd07dd86cf 100644 --- a/sys/dev/ic/aic79xx.c +++ b/sys/dev/ic/aic79xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx.c,v 1.52 2013/12/03 22:49:07 brad Exp $ */ +/* $OpenBSD: aic79xx.c,v 1.53 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -2851,7 +2851,7 @@ ahd_free_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel, int force) tstate = ahd->enabled_targets[scsi_id]; if (tstate != NULL) - free(tstate, M_DEVBUF); + free(tstate, M_DEVBUF, 0); ahd->enabled_targets[scsi_id] = NULL; } #endif @@ -5274,7 +5274,7 @@ ahd_alloc(void *platform_arg, char *name) AHD_INT_COALESCING_STOP_THRESHOLD_DEFAULT; if (ahd_platform_alloc(ahd, platform_arg) != 0) { - free(ahd->seep_config, M_DEVBUF); + free(ahd->seep_config, M_DEVBUF, 0); return (NULL); } @@ -5375,7 +5375,7 @@ void ahd_set_name(struct ahd_softc *ahd, char *name) { if (ahd->name != NULL) - free(ahd->name, M_DEVBUF); + free(ahd->name, M_DEVBUF, 0); ahd->name = name; } @@ -5413,23 +5413,23 @@ ahd_free(struct ahd_softc *ahd) lstate = tstate->enabled_luns[j]; if (lstate != NULL) { xpt_free_path(lstate->path); - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); } } #endif - free(tstate, M_DEVBUF); + free(tstate, M_DEVBUF, 0); } } #if AHD_TARGET_MODE if (ahd->black_hole != NULL) { xpt_free_path(ahd->black_hole->path); - free(ahd->black_hole, M_DEVBUF); + free(ahd->black_hole, M_DEVBUF, 0); } #endif if (ahd->seep_config != NULL) - free(ahd->seep_config, M_DEVBUF); + free(ahd->seep_config, M_DEVBUF, 0); if (ahd->saved_stack != NULL) - free(ahd->saved_stack, M_DEVBUF); + free(ahd->saved_stack, M_DEVBUF, 0); return; } @@ -5719,7 +5719,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) while ((sns_map = SLIST_FIRST(&scb_data->sense_maps)) != NULL) { SLIST_REMOVE_HEAD(&scb_data->sense_maps, links); ahd_freedmamem(ahd, sns_map); - free(sns_map, M_DEVBUF); + free(sns_map, M_DEVBUF, 0); } /* FALLTHROUGH */ } @@ -5730,7 +5730,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) while ((sg_map = SLIST_FIRST(&scb_data->sg_maps)) != NULL) { SLIST_REMOVE_HEAD(&scb_data->sg_maps, links); ahd_freedmamem(ahd, sg_map); - free(sg_map, M_DEVBUF); + free(sg_map, M_DEVBUF, 0); } /* FALLTHROUGH */ } @@ -5741,7 +5741,7 @@ ahd_fini_scbdata(struct ahd_softc *ahd) while ((hscb_map = SLIST_FIRST(&scb_data->hscb_maps)) != NULL) { SLIST_REMOVE_HEAD(&scb_data->hscb_maps, links); ahd_freedmamem(ahd, hscb_map); - free(hscb_map, M_DEVBUF); + free(hscb_map, M_DEVBUF, 0); } /* FALLTHROUGH */ } @@ -5979,7 +5979,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of hardware SCBs */ if (ahd_createdmamem(ahd, PAGE_SIZE, hscb_map, "hardware SCB structures") < 0) { - free(hscb_map, M_DEVBUF); + free(hscb_map, M_DEVBUF, 0); return; } @@ -6009,7 +6009,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of S/G lists */ if (ahd_createdmamem(ahd, ahd_sglist_allocsize(ahd), sg_map, "SG data structures") < 0) { - free(sg_map, M_DEVBUF); + free(sg_map, M_DEVBUF, 0); return; } @@ -6043,7 +6043,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) /* Allocate the next batch of sense buffers */ if (ahd_createdmamem(ahd, PAGE_SIZE, sense_map, "Sense Data structures") < 0) { - free(sense_map, M_DEVBUF); + free(sense_map, M_DEVBUF, 0); return; } @@ -6081,7 +6081,7 @@ ahd_alloc_scbs(struct ahd_softc *ahd) if (sizeof(*pdata) > 0) { pdata = malloc(sizeof(*pdata), M_DEVBUF, M_NOWAIT); if (pdata == NULL) { - free(next_scb, M_DEVBUF); + free(next_scb, M_DEVBUF, 0); break; } } @@ -6116,8 +6116,8 @@ ahd_alloc_scbs(struct ahd_softc *ahd) BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &next_scb->dmamap); if (error != 0) { - free(next_scb, M_DEVBUF); - free(pdata, M_DEVBUF); + free(next_scb, M_DEVBUF, 0); + free(pdata, M_DEVBUF, 0); break; } next_scb->hscb->tag = aic_htole16(scb_data->numscbs); @@ -9601,7 +9601,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) xpt_path_target_id(ccb->ccb_h.path), xpt_path_lun_id(ccb->ccb_h.path)); if (status != CAM_REQ_CMP) { - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); xpt_print_path(ccb->ccb_h.path); printf("Couldn't allocate path\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -9715,7 +9715,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) xpt_print_path(ccb->ccb_h.path); printf("Target mode disabled\n"); xpt_free_path(lstate->path); - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); ahd_pause(ahd); /* Can we clean up the target too? */ diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c index 0197819951a..b19d2ac05f6 100644 --- a/sys/dev/ic/aic79xx_openbsd.c +++ b/sys/dev/ic/aic79xx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic79xx_openbsd.c,v 1.41 2014/01/17 23:23:58 dlg Exp $ */ +/* $OpenBSD: aic79xx_openbsd.c,v 1.42 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom @@ -588,7 +588,7 @@ void ahd_platform_free(struct ahd_softc *ahd) { if (sizeof(struct ahd_platform_data) > 0) - free(ahd->platform_data, M_DEVBUF); + free(ahd->platform_data, M_DEVBUF, 0); } int diff --git a/sys/dev/ic/aic7xxx.c b/sys/dev/ic/aic7xxx.c index c1e29ddd8e0..9d6874f1f09 100644 --- a/sys/dev/ic/aic7xxx.c +++ b/sys/dev/ic/aic7xxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx.c,v 1.86 2013/04/20 20:23:09 miod Exp $ */ +/* $OpenBSD: aic7xxx.c,v 1.87 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: aic7xxx.c,v 1.108 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -40,7 +40,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. * - * $Id: aic7xxx.c,v 1.86 2013/04/20 20:23:09 miod Exp $ + * $Id: aic7xxx.c,v 1.87 2014/07/12 18:48:17 tedu Exp $ */ /* * Ported from FreeBSD by Pascal Renauld, Network Storage Solutions, Inc. - April 2003 @@ -1688,7 +1688,7 @@ ahc_free_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel, int force) scsi_id += 8; tstate = ahc->enabled_targets[scsi_id]; if (tstate != NULL) - free(tstate, M_DEVBUF); + free(tstate, M_DEVBUF, 0); ahc->enabled_targets[scsi_id] = NULL; } #endif @@ -3958,7 +3958,7 @@ void ahc_set_name(struct ahc_softc *ahc, char *name) { if (ahc->name != NULL) - free(ahc->name, M_DEVBUF); + free(ahc->name, M_DEVBUF, 0); ahc->name = name; } @@ -3998,21 +3998,21 @@ ahc_free(struct ahc_softc *ahc) lstate = tstate->enabled_luns[j]; if (lstate != NULL) { /*xpt_free_path(lstate->path);*/ - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); } } #endif - free(tstate, M_DEVBUF); + free(tstate, M_DEVBUF, 0); } } #ifdef AHC_TARGET_MODE if (ahc->black_hole != NULL) { /*xpt_free_path(ahc->black_hole->path);*/ - free(ahc->black_hole, M_DEVBUF); + free(ahc->black_hole, M_DEVBUF, 0); } #endif if (ahc->seep_config != NULL) - free(ahc->seep_config, M_DEVBUF); + free(ahc->seep_config, M_DEVBUF, 0); return; } @@ -4328,7 +4328,7 @@ ahc_fini_scbdata(struct ahc_softc *ahc) ahc_freedmamem(ahc->parent_dmat, PAGE_SIZE, sg_map->sg_dmamap, (caddr_t)sg_map->sg_vaddr, &sg_map->sg_dmasegs, sg_map->sg_nseg); - free(sg_map, M_DEVBUF); + free(sg_map, M_DEVBUF, 0); } } /*FALLTHROUGH*/ @@ -4350,7 +4350,7 @@ ahc_fini_scbdata(struct ahc_softc *ahc) break; } if (scb_data->scbarray != NULL) - free(scb_data->scbarray, M_DEVBUF); + free(scb_data->scbarray, M_DEVBUF, 0); } void @@ -4382,7 +4382,7 @@ ahc_alloc_scbs(struct ahc_softc *ahc) (caddr_t *)&sg_map->sg_vaddr, &sg_map->sg_physaddr, &sg_map->sg_dmasegs, &sg_map->sg_nseg, ahc_name(ahc), "SG space") < 0) { - free(sg_map, M_DEVBUF); + free(sg_map, M_DEVBUF, 0); return; } @@ -6865,7 +6865,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) xpt_path_target_id(ccb->ccb_h.path), xpt_path_lun_id(ccb->ccb_h.path)); if (status != CAM_REQ_CMP) { - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); xpt_print_path(ccb->ccb_h.path); printf("Couldn't allocate path\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -6986,7 +6986,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) xpt_print_path(ccb->ccb_h.path); printf("Target mode disabled\n"); xpt_free_path(lstate->path); - free(lstate, M_DEVBUF); + free(lstate, M_DEVBUF, 0); ahc_pause(ahc); /* Can we clean up the target too? */ diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c index bf81bc036f9..6475611aece 100644 --- a/sys/dev/ic/aic7xxx_openbsd.c +++ b/sys/dev/ic/aic7xxx_openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_openbsd.c,v 1.52 2014/01/17 23:25:07 dlg Exp $ */ +/* $OpenBSD: aic7xxx_openbsd.c,v 1.53 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */ /* @@ -667,7 +667,7 @@ void ahc_platform_free(struct ahc_softc *ahc) { if (sizeof(struct ahc_platform_data) > 0) - free(ahc->platform_data, M_DEVBUF); + free(ahc->platform_data, M_DEVBUF, 0); } int diff --git a/sys/dev/ic/aic7xxx_seeprom.c b/sys/dev/ic/aic7xxx_seeprom.c index 3e576a7f074..00622bc6fa5 100644 --- a/sys/dev/ic/aic7xxx_seeprom.c +++ b/sys/dev/ic/aic7xxx_seeprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aic7xxx_seeprom.c,v 1.4 2008/05/13 02:24:08 brad Exp $ */ +/* $OpenBSD: aic7xxx_seeprom.c,v 1.5 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: aic7xxx_seeprom.c,v 1.8 2003/05/02 19:12:19 dyoung Exp $ */ /* @@ -47,7 +47,7 @@ * from the FreeBSD source file aic7xxx_pci.c by Frank van der Linden * * - * $Id: aic7xxx_seeprom.c,v 1.4 2008/05/13 02:24:08 brad Exp $ + * $Id: aic7xxx_seeprom.c,v 1.5 2014/07/12 18:48:17 tedu Exp $ * * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_pci.c,v 1.22 2003/01/20 20:44:55 gibbs Exp $ */ @@ -196,7 +196,7 @@ ahc_check_extport(struct ahc_softc *ahc, u_int *sxfrctl1) if (bootverbose) printf("%s: No SEEPROM available.\n", ahc_name(ahc)); ahc->flags |= AHC_USEDEFAULTS | AHC_NO_BIOS_INIT; - free(ahc->seep_config, M_DEVBUF); + free(ahc->seep_config, M_DEVBUF, 0); ahc->seep_config = NULL; sc = NULL; } else { diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c index 6099be53d14..f1e3ba6bde1 100644 --- a/sys/dev/ic/ami.c +++ b/sys/dev/ic/ami.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ami.c,v 1.226 2013/10/19 13:03:43 dlg Exp $ */ +/* $OpenBSD: ami.c,v 1.227 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2001 Michael Shalayeff @@ -262,7 +262,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, am->am_map); amfree: - free(am, M_DEVBUF); + free(am, M_DEVBUF, 0); return (NULL); } @@ -274,7 +274,7 @@ ami_freemem(struct ami_softc *sc, struct ami_mem *am) bus_dmamem_unmap(sc->sc_dmat, am->am_kva, am->am_size); bus_dmamem_free(sc->sc_dmat, &am->am_seg, 1); bus_dmamap_destroy(sc->sc_dmat, am->am_map); - free(am, M_DEVBUF); + free(am, M_DEVBUF, 0); } void @@ -363,7 +363,7 @@ free_list: ami_freemem(sc, sc->sc_ccbmem_am); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -1948,7 +1948,7 @@ ami_ioctl_inq(struct ami_softc *sc, struct bioc_inq *bi) bcopy(bi, &sc->sc_bi, sizeof sc->sc_bi); error = 0; bail: - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); done: dma_free(inqbuf, sizeof(*inqbuf)); return (error); @@ -2181,7 +2181,7 @@ ami_ioctl_vol(struct ami_softc *sc, struct bioc_vol *bv) strlcpy(bv->bv_dev, sc->sc_hdr[i].dev, sizeof(bv->bv_dev)); bail: - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); return (error); } @@ -2293,7 +2293,7 @@ ami_ioctl_disk(struct ami_softc *sc, struct bioc_disk *bd) done: error = 0; bail: - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); dma_free(vpdbuf, sizeof(*vpdbuf)); dma_free(inqbuf, sizeof(*inqbuf)); @@ -2444,9 +2444,9 @@ ami_create_sensors(struct ami_softc *sc) return (0); freebd: - free(sc->sc_bd, M_DEVBUF); + free(sc->sc_bd, M_DEVBUF, 0); bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c index 1f84c2717f6..0a55576527e 100644 --- a/sys/dev/ic/ar5008.c +++ b/sys/dev/ic/ar5008.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5008.c,v 1.23 2013/08/07 01:06:28 bluhm Exp $ */ +/* $OpenBSD: ar5008.c,v 1.24 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -658,7 +658,7 @@ ar5008_rx_free(struct athn_softc *sc) if (bf->bf_m != NULL) m_freem(bf->bf_m); } - free(rxq->bf, M_DEVBUF); + free(rxq->bf, M_DEVBUF, 0); /* Free Rx descriptors. */ if (rxq->map != NULL) { diff --git a/sys/dev/ic/ar5210.c b/sys/dev/ic/ar5210.c index 2889b784d95..26f20ef1ed0 100644 --- a/sys/dev/ic/ar5210.c +++ b/sys/dev/ic/ar5210.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5210.c,v 1.45 2009/06/02 12:39:02 reyk Exp $ */ +/* $OpenBSD: ar5210.c,v 1.46 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter @@ -354,7 +354,7 @@ ar5k_ar5210_detach(struct ath_hal *hal) /* * Free HAL structure, assume interrupts are down */ - free(hal, M_DEVBUF); + free(hal, M_DEVBUF, 0); } HAL_BOOL diff --git a/sys/dev/ic/ar5211.c b/sys/dev/ic/ar5211.c index 853b5b2aad6..69adc4d3386 100644 --- a/sys/dev/ic/ar5211.c +++ b/sys/dev/ic/ar5211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5211.c,v 1.45 2012/08/30 11:03:57 jsg Exp $ */ +/* $OpenBSD: ar5211.c,v 1.46 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter @@ -404,7 +404,7 @@ ar5k_ar5211_detach(struct ath_hal *hal) /* * Free HAL structure, assume interrupts are down */ - free(hal, M_DEVBUF); + free(hal, M_DEVBUF, 0); } HAL_BOOL diff --git a/sys/dev/ic/ar5212.c b/sys/dev/ic/ar5212.c index 877a012ab65..4b77f6a7620 100644 --- a/sys/dev/ic/ar5212.c +++ b/sys/dev/ic/ar5212.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5212.c,v 1.54 2014/07/09 16:36:13 stsp Exp $ */ +/* $OpenBSD: ar5212.c,v 1.55 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter @@ -457,12 +457,12 @@ void ar5k_ar5212_detach(struct ath_hal *hal) { if (hal->ah_rf_banks != NULL) - free(hal->ah_rf_banks, M_DEVBUF); + free(hal->ah_rf_banks, M_DEVBUF, 0); /* * Free HAL structure, assume interrupts are down */ - free(hal, M_DEVBUF); + free(hal, M_DEVBUF, 0); } HAL_BOOL diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c index f98043d78e5..dd86d6cd50a 100644 --- a/sys/dev/ic/ar5xxx.c +++ b/sys/dev/ic/ar5xxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar5xxx.c,v 1.56 2012/01/28 12:45:48 stsp Exp $ */ +/* $OpenBSD: ar5xxx.c,v 1.57 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter @@ -295,7 +295,7 @@ ath_hal_attach(u_int16_t device, void *arg, bus_space_tag_t st, return (hal); failed: - free(hal, M_DEVBUF); + free(hal, M_DEVBUF, 0); return (NULL); } @@ -506,7 +506,7 @@ ath_hal_init_channels(struct ath_hal *hal, HAL_CHANNEL *channels, done: bcopy(all_channels, channels, sizeof(HAL_CHANNEL) * max_channels); *channels_size = c; - free(all_channels, M_TEMP); + free(all_channels, M_TEMP, 0); return (AH_TRUE); } diff --git a/sys/dev/ic/ar9003.c b/sys/dev/ic/ar9003.c index b738ff2688e..e80726f9db8 100644 --- a/sys/dev/ic/ar9003.c +++ b/sys/dev/ic/ar9003.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar9003.c,v 1.27 2013/08/07 01:06:28 bluhm Exp $ */ +/* $OpenBSD: ar9003.c,v 1.28 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -491,7 +491,7 @@ ar9003_read_rom(struct athn_softc *sc) if (error == 0) ops->swap_rom(sc); #endif - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return (error); } @@ -793,7 +793,7 @@ ar9003_rx_free(struct athn_softc *sc, int qid) if (bf->bf_m != NULL) m_freem(bf->bf_m); } - free(rxq->bf, M_DEVBUF); + free(rxq->bf, M_DEVBUF, 0); } void diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 1327d85f077..202a4eb4324 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ath.c,v 1.100 2014/07/10 11:34:48 stsp Exp $ */ +/* $OpenBSD: ath.c,v 1.101 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */ /*- @@ -1678,7 +1678,7 @@ ath_desc_free(struct ath_softc *sc) TAILQ_INIT(&sc->sc_rxbuf); TAILQ_INIT(&sc->sc_txbuf); TAILQ_INIT(&sc->sc_txq); - free(sc->sc_bufptr, M_DEVBUF); + free(sc->sc_bufptr, M_DEVBUF, 0); sc->sc_bufptr = NULL; } @@ -2999,7 +2999,7 @@ ath_getchannels(struct ath_softc *sc, HAL_BOOL outdoor, HAL_BOOL xchanmode) HAL_MODE_ALL, outdoor, xchanmode)) { printf("%s: unable to collect channel list from hal\n", ifp->if_xname); - free(chans, M_TEMP); + free(chans, M_TEMP, 0); return EINVAL; } @@ -3030,7 +3030,7 @@ ath_getchannels(struct ath_softc *sc, HAL_BOOL outdoor, HAL_BOOL xchanmode) /* count valid channels */ sc->sc_nchan++; } - free(chans, M_TEMP); + free(chans, M_TEMP, 0); if (sc->sc_nchan < 1) { printf("%s: no valid channels for regdomain %s(%u)\n", diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c index d0c7a498686..213178085f0 100644 --- a/sys/dev/ic/athn.c +++ b/sys/dev/ic/athn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: athn.c,v 1.81 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: athn.c,v 1.82 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -393,7 +393,7 @@ athn_detach(struct athn_softc *sc) } /* Free ROM copy. */ if (sc->eep != NULL) - free(sc->eep, M_DEVBUF); + free(sc->eep, M_DEVBUF, 0); ieee80211_ifdetach(ifp); if_detach(ifp); diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index da599fdab11..64a8e3637e2 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.82 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: atw.c,v 1.83 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -423,7 +423,7 @@ atw_read_srom(struct atw_softc *sc) if (!read_seeprom(&sd, sc->sc_srom, 0, sc->sc_sromsz/2)) { printf("%s: could not read SROM\n", sc->sc_dev.dv_xname); - free(sc->sc_srom, M_DEVBUF); + free(sc->sc_srom, M_DEVBUF, 0); return -1; } #ifdef ATW_DEBUG @@ -2743,7 +2743,7 @@ atw_detach(struct atw_softc *sc) bus_dmamem_free(sc->sc_dmat, &sc->sc_cdseg, sc->sc_cdnseg); if (sc->sc_srom) - free(sc->sc_srom, M_DEVBUF); + free(sc->sc_srom, M_DEVBUF, 0); return (0); } diff --git a/sys/dev/ic/bwi.c b/sys/dev/ic/bwi.c index 2f316ecab99..33a9b4eda11 100644 --- a/sys/dev/ic/bwi.c +++ b/sys/dev/ic/bwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwi.c,v 1.101 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: bwi.c,v 1.102 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -1660,7 +1660,7 @@ bwi_get_firmware(const char *name, const uint8_t *ucode, size_t size_ucode, } } - free(h, M_DEVBUF); + free(h, M_DEVBUF, 0); return (ret); } @@ -1837,7 +1837,7 @@ void bwi_mac_fw_free(struct bwi_mac *mac) { if (mac->mac_fw != NULL) { - free(mac->mac_fw, M_DEVBUF); + free(mac->mac_fw, M_DEVBUF, 0); mac->mac_fw = NULL; } } @@ -7798,7 +7798,7 @@ bwi_dma_txstats_free(struct bwi_softc *sc) bus_dmamap_unload(sc->sc_dmat, st->stats_dmap); bus_dmamem_free(sc->sc_dmat, &st->stats_seg, 1); - free(st, M_DEVBUF); + free(st, M_DEVBUF, 0); } int diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index d19899b87bc..2d90a355848 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.50 2013/05/30 16:15:02 deraadt Exp $ */ +/* $OpenBSD: cac.c,v 1.51 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -943,7 +943,7 @@ cac_create_sensors(struct cac_softc *sc) return (0); bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c index c9a4fa1a1f4..aa61a284c5c 100644 --- a/sys/dev/ic/ciss.c +++ b/sys/dev/ic/ciss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $ */ +/* $OpenBSD: ciss.c,v 1.69 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005,2006 Michael Shalayeff @@ -403,7 +403,7 @@ ciss_attach(struct ciss_softc *sc) sensor_attach(&sc->sensordev, &sc->sensors[i]); } if (sensor_task_register(sc, ciss_sensors, 10) == NULL) - free(sc->sensors, M_DEVBUF); + free(sc->sensors, M_DEVBUF, 0); else sensordev_install(&sc->sensordev); } diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 50fe708ded2..f87d8dc15e5 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.132 2014/04/18 14:56:59 henning Exp $ */ +/* $OpenBSD: dc.c,v 1.133 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -3128,7 +3128,7 @@ dc_detach(struct dc_softc *sc) mii_detach(&sc->sc_mii, MII_PHY_ANY, MII_OFFSET_ANY); if (sc->dc_srom) - free(sc->dc_srom, M_DEVBUF); + free(sc->dc_srom, M_DEVBUF, 0); for (i = 0; i < DC_RX_LIST_CNT; i++) bus_dmamap_destroy(sc->sc_dmat, sc->dc_cdata.dc_rx_chain[i].sd_map); diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c index 183b4dbc917..d9df07c37ea 100644 --- a/sys/dev/ic/fxp.c +++ b/sys/dev/ic/fxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fxp.c,v 1.115 2013/12/28 03:34:59 deraadt Exp $ */ +/* $OpenBSD: fxp.c,v 1.116 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */ /* @@ -1056,7 +1056,7 @@ fxp_detach(struct fxp_softc *sc) #ifndef SMALL_KERNEL if (sc->sc_ucodebuf) - free(sc->sc_ucodebuf, M_DEVBUF); + free(sc->sc_ucodebuf, M_DEVBUF, 0); #endif } diff --git a/sys/dev/ic/i82365.c b/sys/dev/ic/i82365.c index 797391f7945..1dd43555e17 100644 --- a/sys/dev/ic/i82365.c +++ b/sys/dev/ic/i82365.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i82365.c,v 1.31 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: i82365.c,v 1.32 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: i82365.c,v 1.10 1998/06/09 07:36:55 thorpej Exp $ */ /* @@ -469,9 +469,9 @@ pcic_event_process(h, pe) break; if (pe2->pe_type == PCIC_EVENT_INSERTION) { SIMPLEQ_REMOVE_HEAD(&h->events, pe_q); - free(pe1, M_TEMP); + free(pe1, M_TEMP, 0); SIMPLEQ_REMOVE_HEAD(&h->events, pe_q); - free(pe2, M_TEMP); + free(pe2, M_TEMP, 0); } } splx(s); @@ -493,9 +493,9 @@ pcic_event_process(h, pe) break; if (pe2->pe_type == PCIC_EVENT_REMOVAL) { SIMPLEQ_REMOVE_HEAD(&h->events, pe_q); - free(pe1, M_TEMP); + free(pe1, M_TEMP, 0); SIMPLEQ_REMOVE_HEAD(&h->events, pe_q); - free(pe2, M_TEMP); + free(pe2, M_TEMP, 0); } } splx(s); @@ -507,7 +507,7 @@ pcic_event_process(h, pe) default: panic("pcic_event_thread: unknown event %d", pe->pe_type); } - free(pe, M_TEMP); + free(pe, M_TEMP, 0); } void diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c index 6db2fdc4b76..8be1e5a491a 100644 --- a/sys/dev/ic/i82596.c +++ b/sys/dev/ic/i82596.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i82596.c,v 1.37 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: i82596.c,v 1.38 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */ /*- @@ -1973,7 +1973,7 @@ ie_mc_reset(sc) if (size > sc->mcast_addrs_size) { /* Need to allocate more space */ if (sc->mcast_addrs_size) - free(sc->mcast_addrs, M_IFMADDR); + free(sc->mcast_addrs, M_IFMADDR, 0); sc->mcast_addrs = (char *) malloc(size, M_IFMADDR, M_WAITOK); sc->mcast_addrs_size = size; diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 0c44fd50a47..71dd4280c7b 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.154 2013/11/26 09:50:33 mpi Exp $ */ +/* $OpenBSD: if_wi.c,v 1.155 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1976,7 +1976,7 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) na->na_nodes++; } if (nr) - free(nr, M_DEVBUF); + free(nr, M_DEVBUF, 0); break; } case SIOCG80211FLAGS: @@ -2031,9 +2031,9 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } if (wreq) - free(wreq, M_DEVBUF); + free(wreq, M_DEVBUF, 0); if (nwidp) - free(nwidp, M_DEVBUF); + free(nwidp, M_DEVBUF, 0); fail: sc->wi_flags &= ~WI_FLAGS_BUSY; diff --git a/sys/dev/ic/if_wi_hostap.c b/sys/dev/ic/if_wi_hostap.c index 155ad0f8ecb..fb1ae619337 100644 --- a/sys/dev/ic/if_wi_hostap.c +++ b/sys/dev/ic/if_wi_hostap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_hostap.c,v 1.42 2013/08/07 01:06:30 bluhm Exp $ */ +/* $OpenBSD: if_wi_hostap.c,v 1.43 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2002 @@ -296,8 +296,8 @@ wihap_shutdown(struct wi_softc *sc) printf("wihap_shutdown: free(sta=%p)\n", sta); next = TAILQ_NEXT(sta, list); if (sta->challenge) - free(sta->challenge, M_TEMP); - free(sta, M_DEVBUF); + free(sta->challenge, M_TEMP, 0); + free(sta, M_DEVBUF, 0); } TAILQ_INIT(&whi->sta_list); @@ -442,8 +442,8 @@ wihap_sta_delete(struct wihap_sta_info *sta) TAILQ_REMOVE(&whi->sta_list, sta, list); LIST_REMOVE(sta, hash); if (sta->challenge) - free(sta->challenge, M_TEMP); - free(sta, M_DEVBUF); + free(sta->challenge, M_TEMP, 0); + free(sta, M_DEVBUF, 0); whi->n_stations--; } @@ -669,7 +669,7 @@ wihap_auth_req(struct wi_softc *sc, struct wi_frame *rxfrm, } sta->flags |= WI_SIFLAGS_AUTHEN; - free(sta->challenge, M_TEMP); + free(sta->challenge, M_TEMP, 0); sta->challenge = NULL; challenge_len = 0; break; diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c index 0722b6d0160..bf85ed4d2c6 100644 --- a/sys/dev/ic/malo.c +++ b/sys/dev/ic/malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malo.c,v 1.98 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: malo.c,v 1.99 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -683,7 +683,7 @@ malo_free_rx_ring(struct malo_softc *sc, struct malo_rx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } @@ -834,7 +834,7 @@ malo_free_tx_ring(struct malo_softc *sc, struct malo_tx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } @@ -1803,10 +1803,10 @@ malo_load_bootimg(struct malo_softc *sc) if (i == 10) { printf("%s: timeout at boot firmware load!\n", sc->sc_dev.dv_xname); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (ETIMEDOUT); } - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); /* tell the card we're done and... */ malo_mem_write2(sc, 0xbef8, 0x001); @@ -1858,7 +1858,7 @@ malo_load_firmware(struct malo_softc *sc) BUS_DMASYNC_POSTWRITE); delay(500); } - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); DPRINTF(1, "%s: firmware upload finished\n", sc->sc_dev.dv_xname); diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index cb8412eec15..fa15b75f4e1 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.152 2014/05/04 20:09:15 sf Exp $ */ +/* $OpenBSD: mfi.c,v 1.153 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 Marco Peereboom * @@ -293,7 +293,7 @@ destroy: while ((ccb = mfi_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); } @@ -364,7 +364,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, mm->am_map); amfree: - free(mm, M_DEVBUF); + free(mm, M_DEVBUF, 0); return (NULL); } @@ -378,7 +378,7 @@ mfi_freemem(struct mfi_softc *sc, struct mfi_mem *mm) bus_dmamem_unmap(sc->sc_dmat, mm->am_kva, mm->am_size); bus_dmamem_free(sc->sc_dmat, &mm->am_seg, 1); bus_dmamap_destroy(sc->sc_dmat, mm->am_map); - free(mm, M_DEVBUF); + free(mm, M_DEVBUF, 0); } int @@ -847,7 +847,7 @@ mfi_syspd(struct mfi_softc *sc) sc->sc_pd->pd_links[i] = pl; } - free(pd, M_TEMP); + free(pd, M_TEMP, 0); link = &sc->sc_pd->pd_link; link->adapter = &mfi_pd_switch; @@ -870,12 +870,12 @@ nopl: if (pl == NULL) break; - free(pl, M_DEVBUF); + free(pl, M_DEVBUF, 0); } nopd: - free(pd, M_TEMP); + free(pd, M_TEMP, 0); nopdsc: - free(sc->sc_pd, M_DEVBUF); + free(sc->sc_pd, M_DEVBUF, 0); return (1); } @@ -1471,25 +1471,25 @@ mfi_bio_getitall(struct mfi_softc *sc) goto done; if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, sizeof *cfg, cfg, NULL)) { - free(cfg, M_DEVBUF); + free(cfg, M_DEVBUF, 0); goto done; } size = cfg->mfc_size; - free(cfg, M_DEVBUF); + free(cfg, M_DEVBUF, 0); /* memory for read config */ cfg = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); if (cfg == NULL) goto done; if (mfi_mgmt(sc, MR_DCMD_CONF_GET, MFI_DATA_IN, size, cfg, NULL)) { - free(cfg, M_DEVBUF); + free(cfg, M_DEVBUF, 0); goto done; } /* replace current pointer with new one */ if (sc->sc_cfg) - free(sc->sc_cfg, M_DEVBUF); + free(sc->sc_cfg, M_DEVBUF, 0); sc->sc_cfg = cfg; /* get all ld info */ @@ -1501,7 +1501,7 @@ mfi_bio_getitall(struct mfi_softc *sc) size = cfg->mfc_no_ld * sizeof(struct mfi_ld_details); if (sc->sc_ld_sz != size) { if (sc->sc_ld_details) - free(sc->sc_ld_details, M_DEVBUF); + free(sc->sc_ld_details, M_DEVBUF, 0); ld_det = malloc( size, M_DEVBUF, M_NOWAIT | M_ZERO); if (ld_det == NULL) @@ -1757,7 +1757,7 @@ mfi_ioctl_disk(struct mfi_softc *sc, struct bioc_disk *bd) rv = 0; freeme: - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); return (rv); } @@ -1865,7 +1865,7 @@ mfi_ioctl_blink(struct mfi_softc *sc, struct bioc_blink *bb) rv = 0; done: - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); return (rv); } @@ -1927,7 +1927,7 @@ mfi_ioctl_setstate(struct mfi_softc *sc, struct bioc_setstate *bs) rv = 0; done: - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); return (rv); } @@ -1958,7 +1958,7 @@ mfi_bio_hs(struct mfi_softc *sc, int volid, int type, void *bio_hs) goto freeme; size = cfg->mfc_size; - free(cfg, M_DEVBUF); + free(cfg, M_DEVBUF, 0); /* memory for read config */ cfg = malloc(size, M_DEVBUF, M_WAITOK|M_ZERO); @@ -2023,8 +2023,8 @@ mfi_bio_hs(struct mfi_softc *sc, int volid, int type, void *bio_hs) DNPRINTF(MFI_D_IOCTL, "%s: mfi_vol_hs 6\n", DEVNAME(sc)); rv = 0; freeme: - free(pd, M_DEVBUF); - free(cfg, M_DEVBUF); + free(pd, M_DEVBUF, 0); + free(cfg, M_DEVBUF, 0); return (rv); } @@ -2191,7 +2191,7 @@ mfi_create_sensors(struct mfi_softc *sc) return (0); bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index b455c95b6f1..86648e4ed5e 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.191 2014/04/16 01:19:28 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.192 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne @@ -399,7 +399,7 @@ free_ccbs: while ((ccb = mpi_get_ccb(sc)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); mpi_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return(1); } @@ -563,7 +563,7 @@ mpi_run_ppr(struct mpi_softc *sc) } out: - free(physdisk_pg, M_TEMP); + free(physdisk_pg, M_TEMP, 0); } int @@ -859,7 +859,7 @@ mpi_cfg_sas(struct mpi_softc *sc) } out: - free(pg, M_TEMP); + free(pg, M_TEMP, 0); return (rv); } @@ -1023,7 +1023,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, mdm->mdm_map); mdmfree: - free(mdm, M_DEVBUF); + free(mdm, M_DEVBUF, 0); return (NULL); } @@ -1037,7 +1037,7 @@ mpi_dmamem_free(struct mpi_softc *sc, struct mpi_dmamem *mdm) bus_dmamem_unmap(sc->sc_dmat, mdm->mdm_kva, mdm->mdm_size); bus_dmamem_free(sc->sc_dmat, &mdm->mdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, mdm->mdm_map); - free(mdm, M_DEVBUF); + free(mdm, M_DEVBUF, 0); } int @@ -1105,7 +1105,7 @@ free_maps: mpi_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -1163,7 +1163,7 @@ mpi_alloc_replies(struct mpi_softc *sc) sc->sc_replies = mpi_dmamem_alloc(sc, sc->sc_repq * MPI_REPLY_SIZE); if (sc->sc_replies == NULL) { - free(sc->sc_rcbs, M_DEVBUF); + free(sc->sc_rcbs, M_DEVBUF, 0); return (1); } @@ -1637,7 +1637,7 @@ mpi_scsi_probe_virtual(struct scsi_link *link) if (rv == 0) SET(link->flags, SDEV_VIRTUAL); - free(rp0, M_TEMP); + free(rp0, M_TEMP, 0); return (0); } @@ -2722,7 +2722,7 @@ mpi_manufacturing(struct mpi_softc *sc) rv = 0; out: - free(pg, M_TEMP); + free(pg, M_TEMP, 0); return (rv); } @@ -2775,7 +2775,7 @@ mpi_get_raid(struct mpi_softc *sc) sc->sc_flags |= MPI_F_RAID; out: - free(vol_page, M_TEMP); + free(vol_page, M_TEMP, 0); } int @@ -3098,7 +3098,7 @@ mpi_ioctl_cache(struct scsi_link *link, u_long cmd, struct dk_cache *dc) scsi_io_put(&sc->sc_iopool, ccb); done: - free(rpg0, M_TEMP); + free(rpg0, M_TEMP, 0); return (rv); } @@ -3136,7 +3136,7 @@ mpi_bio_get_pg0_raid(struct mpi_softc *sc, int id) goto done; } if (sc->sc_rpg0) - free(sc->sc_rpg0, M_DEVBUF); + free(sc->sc_rpg0, M_DEVBUF, 0); sc->sc_rpg0 = rpg0; /* get raid vol page 0 */ @@ -3464,7 +3464,7 @@ mpi_create_sensors(struct mpi_softc *sc) return (0); bad: - free(sc->sc_sensors, M_DEVBUF); + free(sc->sc_sensors, M_DEVBUF, 0); return (1); } diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index a4785eb0634..91211103d41 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.57 2014/01/26 17:26:55 miod Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.58 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -822,7 +822,7 @@ ncr53c9x_scsi_free(struct scsi_link *sc_link) ti->lun[lun] = NULL; splx(s); - free(li, M_DEVBUF); + free(li, M_DEVBUF, 0); } /* diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 59f7fb9f881..8e2ae166171 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nvme.c,v 1.4 2014/04/16 01:28:02 dlg Exp $ */ +/* $OpenBSD: nvme.c,v 1.5 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2014 David Gwynne @@ -571,7 +571,7 @@ nvme_ccbs_free(struct nvme_softc *sc) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); } - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); } struct nvme_queue * @@ -615,7 +615,7 @@ nvme_q_alloc(struct nvme_softc *sc, u_int idx, u_int entries, u_int dstrd) free_sq: nvme_dmamem_free(sc, q->q_sq_dmamem); free: - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); return (NULL); } @@ -629,7 +629,7 @@ nvme_q_free(struct nvme_softc *sc, struct nvme_queue *q) 0, NVME_DMA_LEN(q->q_sq_dmamem), BUS_DMASYNC_POSTWRITE); nvme_dmamem_free(sc, q->q_cq_dmamem); nvme_dmamem_free(sc, q->q_sq_dmamem); - free(q, M_DEVBUF); + free(q, M_DEVBUF, 0); } int @@ -677,7 +677,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); ndmfree: - free(ndm, M_DEVBUF); + free(ndm, M_DEVBUF, 0); return (NULL); } @@ -689,6 +689,6 @@ nvme_dmamem_free(struct nvme_softc *sc, struct nvme_dmamem *ndm) bus_dmamem_unmap(sc->sc_dmat, ndm->ndm_kva, ndm->ndm_size); bus_dmamem_free(sc->sc_dmat, &ndm->ndm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, ndm->ndm_map); - free(ndm, M_DEVBUF); + free(ndm, M_DEVBUF, 0); } diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index a7de558fe91..7e5c4f0aaa7 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.73 2013/12/06 21:03:03 deraadt Exp $ */ +/* $OpenBSD: pgt.c,v 1.74 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -312,7 +312,7 @@ pgt_load_firmware(struct pgt_softc *sc) if (size & 3) { DPRINTF(("%s: bad firmware size %u\n", sc->sc_dev.dv_xname, size)); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (EINVAL); } @@ -366,7 +366,7 @@ pgt_load_firmware(struct pgt_softc *sc) pgt_write_memory_barrier(sc); DELAY(PGT_WRITEIO_DELAY); - free(ucode, M_DEVBUF); + free(ucode, M_DEVBUF, 0); return (0); } @@ -1827,7 +1827,7 @@ pgt_ieee80211_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) struct pgt_ieee80211_node *pin; pin = (struct pgt_ieee80211_node *)ni; - free(pin, M_DEVBUF); + free(pin, M_DEVBUF, 0); } void @@ -1898,7 +1898,7 @@ pgt_net_attach(struct pgt_softc *sc) freqs = malloc(j, M_DEVBUF, M_WAITOK); error = pgt_oid_get(sc, PGT_OID_SUPPORTED_FREQUENCIES, freqs, j); if (error) { - free(freqs, M_DEVBUF); + free(freqs, M_DEVBUF, 0); return (error); } @@ -1909,7 +1909,7 @@ pgt_net_attach(struct pgt_softc *sc) if (chan > IEEE80211_CHAN_MAX) { printf("%s: reported bogus channel (%uMHz)\n", sc->sc_dev.dv_xname, chan); - free(freqs, M_DEVBUF); + free(freqs, M_DEVBUF, 0); return (EIO); } @@ -1940,7 +1940,7 @@ pgt_net_attach(struct pgt_softc *sc) sc->sc_dev.dv_xname, chan, letoh16(freqs->pof_freqlist_mhz[i]))); } - free(freqs, M_DEVBUF); + free(freqs, M_DEVBUF, 0); if (firstchan == -1) { printf("%s: no channels found\n", sc->sc_dev.dv_xname); return (EIO); @@ -2348,9 +2348,9 @@ pgt_ioctl(struct ifnet *ifp, u_long cmd, caddr_t req) na->na_nodes++; } if (nr) - free(nr, M_DEVBUF); - free(pob, M_DEVBUF); - free(wreq, M_DEVBUF); + free(nr, M_DEVBUF, 0); + free(pob, M_DEVBUF, 0); + free(wreq, M_DEVBUF, 0); break; } case SIOCSIFADDR: @@ -3184,7 +3184,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq) if (error != 0) { printf("%s: can not create DMA tag for fragment\n", sc->sc_dev.dv_xname); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); break; } @@ -3193,7 +3193,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq) if (error != 0) { printf("%s: error alloc frag %zu on queue %u\n", sc->sc_dev.dv_xname, i, pq); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); break; } @@ -3202,7 +3202,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq) if (error != 0) { printf("%s: error map frag %zu on queue %u\n", sc->sc_dev.dv_xname, i, pq); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); break; } @@ -3214,7 +3214,7 @@ pgt_dma_alloc_queue(struct pgt_softc *sc, enum pgt_queue pq) sc->sc_dev.dv_xname, i, pq); bus_dmamem_free(sc->sc_dmat, &pd->pd_dmas, nsegs); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); break; } pd->pd_dmaaddr = pd->pd_dmam->dm_segs[0].ds_addr; @@ -3274,7 +3274,7 @@ pgt_dma_free_queue(struct pgt_softc *sc, enum pgt_queue pq) pd->pd_dmam = NULL; } bus_dmamem_free(sc->sc_dmat, &pd->pd_dmas, 1); - free(pd, M_DEVBUF); + free(pd, M_DEVBUF, 0); } } diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c index 19476e41098..7a520c6ae1b 100644 --- a/sys/dev/ic/qla.c +++ b/sys/dev/ic/qla.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla.c,v 1.41 2014/05/21 23:01:43 jmatthew Exp $ */ +/* $OpenBSD: qla.c,v 1.42 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -309,11 +309,11 @@ qla_add_loop_port(struct qla_softc *sc, struct qla_fc_port *port) sc->sc_targets[port->loopid] = port; break; case QLA_PORT_DISP_DUP: - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); break; case QLA_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); @@ -1725,13 +1725,13 @@ qla_clear_port_lists(struct qla_softc *sc) while (!TAILQ_EMPTY(&sc->sc_ports_found)) { p = TAILQ_FIRST(&sc->sc_ports_found); TAILQ_REMOVE(&sc->sc_ports_found, p, update); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!TAILQ_EMPTY(&sc->sc_ports_new)) { p = TAILQ_FIRST(&sc->sc_ports_new); TAILQ_REMOVE(&sc->sc_ports_new, p, update); - free(p, M_DEVBUF); + free(p, M_DEVBUF, 0); } while (!TAILQ_EMPTY(&sc->sc_ports_gone)) { @@ -1775,7 +1775,7 @@ qla_do_update(void *xsc, void *x) if (port->location & QLA_LOCATION_FABRIC) qla_fabric_plogo(sc, port); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } qla_update_done(sc, QLA_UPDATE_TASK_CLEAR_ALL); @@ -1862,12 +1862,12 @@ qla_do_update(void *xsc, void *x) DPRINTF(QLA_D_PORT, "%s: loop port %d\n", DEVNAME(sc), fport->loopid); if (qla_add_loop_port(sc, fport) != 0) - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); } else if (fport->location & QLA_LOCATION_FABRIC) { qla_add_fabric_port(sc, fport); } else { /* already processed */ - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); } continue; } @@ -1904,7 +1904,7 @@ qla_do_update(void *xsc, void *x) fport, update); break; case QLA_PORT_DISP_DUP: - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); break; case QLA_PORT_DISP_SAME: DPRINTF(QLA_D_PORT, "%s: existing port" @@ -1912,7 +1912,7 @@ qla_do_update(void *xsc, void *x) fport->portid); TAILQ_REMOVE(&sc->sc_ports_gone, port, update); - free(fport, M_DEVBUF); + free(fport, M_DEVBUF, 0); break; } mtx_leave(&sc->sc_port_mtx); @@ -1942,7 +1942,7 @@ qla_do_update(void *xsc, void *x) if (qla_fabric_plogi(sc, port) == 0) { qla_add_fabric_port(sc, port); } else { - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } } else { DPRINTF(QLA_D_PORT, "%s: done with logins\n", @@ -1990,7 +1990,7 @@ qla_do_update(void *xsc, void *x) if (port->location & QLA_LOCATION_FABRIC) qla_fabric_plogo(sc, port); - free(port, M_DEVBUF); + free(port, M_DEVBUF, 0); } else { qla_update_done(sc, QLA_UPDATE_TASK_DETACH_TARGET); @@ -2519,7 +2519,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); qdmfree: - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return (NULL); } @@ -2531,7 +2531,7 @@ qla_dmamem_free(struct qla_softc *sc, struct qla_dmamem *m) bus_dmamem_unmap(sc->sc_dmat, m->qdm_kva, m->qdm_size); bus_dmamem_free(sc->sc_dmat, &m->qdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); } int @@ -2610,7 +2610,7 @@ free_res: free_req: qla_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -2626,7 +2626,7 @@ qla_free_ccbs(struct qla_softc *sc) qla_dmamem_free(sc, sc->sc_segments); qla_dmamem_free(sc, sc->sc_responses); qla_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); } void * diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c index 325c7611786..37f21205760 100644 --- a/sys/dev/ic/qlw.c +++ b/sys/dev/ic/qlw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw.c,v 1.22 2014/04/06 20:17:23 kettenis Exp $ */ +/* $OpenBSD: qlw.c,v 1.23 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -1673,7 +1673,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); qdmfree: - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); return (NULL); } @@ -1685,7 +1685,7 @@ qlw_dmamem_free(struct qlw_softc *sc, struct qlw_dmamem *m) bus_dmamem_unmap(sc->sc_dmat, m->qdm_kva, m->qdm_size); bus_dmamem_free(sc->sc_dmat, &m->qdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, m->qdm_map); - free(m, M_DEVBUF); + free(m, M_DEVBUF, 0); } int @@ -1749,7 +1749,7 @@ free_maps: free_req: qlw_dmamem_free(sc, sc->sc_requests); free_ccbs: - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); return (1); } @@ -1764,7 +1764,7 @@ qlw_free_ccbs(struct qlw_softc *sc) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); qlw_dmamem_free(sc, sc->sc_responses); qlw_dmamem_free(sc, sc->sc_requests); - free(sc->sc_ccbs, M_DEVBUF); + free(sc->sc_ccbs, M_DEVBUF, 0); } void * diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index 8749e1d2e15..fc9c24b0351 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.63 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: rt2560.c,v 1.64 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -483,7 +483,7 @@ rt2560_free_tx_ring(struct rt2560_softc *sc, struct rt2560_tx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } @@ -638,7 +638,7 @@ rt2560_free_rx_ring(struct rt2560_softc *sc, struct rt2560_rx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index bb9eabe3f11..caa37d0e1ce 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.72 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: rt2661.c,v 1.73 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2006 @@ -401,7 +401,7 @@ rt2661_detach(void *xsc) rt2661_free_rx_ring(sc, &sc->rxq); if (sc->ucode != NULL) - free(sc->ucode, M_DEVBUF); + free(sc->ucode, M_DEVBUF, 0); return 0; } @@ -566,7 +566,7 @@ rt2661_free_tx_ring(struct rt2661_softc *sc, struct rt2661_tx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } @@ -717,7 +717,7 @@ rt2661_free_rx_ring(struct rt2661_softc *sc, struct rt2661_rx_ring *ring) if (data->map != NULL) bus_dmamap_destroy(sc->sc_dmat, data->map); } - free(ring->data, M_DEVBUF); + free(ring->data, M_DEVBUF, 0); } } @@ -758,7 +758,7 @@ rt2661_amrr_node_free(struct rt2661_softc *sc, struct rt2661_amrr_node *amn) TAILQ_REMOVE(&sc->amn, amn, entry); sc->amn_count--; splx(s); - free(amn, M_DEVBUF); + free(amn, M_DEVBUF, 0); } void diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c index 7879145f740..ac22ff942ba 100644 --- a/sys/dev/ic/rt2860.c +++ b/sys/dev/ic/rt2860.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860.c,v 1.72 2014/03/19 10:09:19 mpi Exp $ */ +/* $OpenBSD: rt2860.c,v 1.73 2014/07/12 18:48:17 tedu Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini @@ -399,7 +399,7 @@ rt2860_detach(void *xsc) rt2860_free_tx_pool(sc); if (sc->ucode != NULL) - free(sc->ucode, M_DEVBUF); + free(sc->ucode, M_DEVBUF, 0); return 0; } diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index 651e75d91be..f63657cd3bf 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtw.c,v 1.85 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: rtw.c,v 1.86 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: rtw.c,v 1.29 2004/12/27 19:49:16 dyoung Exp $ */ /*- @@ -690,7 +690,7 @@ rtw_srom_read(struct rtw_regs *regs, u_int32_t flags, struct rtw_srom *sr, /* TBD bus barriers */ if (!read_seeprom(&sd, sr->sr_content, 0, sr->sr_size/2)) { printf("\n%s: could not read SROM\n", dvname); - free(sr->sr_content, M_DEVBUF); + free(sr->sr_content, M_DEVBUF, 0); sr->sr_content = NULL; return -1; /* XXX */ } @@ -3629,7 +3629,7 @@ rtw_txsoft_blk_cleanup_all(struct rtw_softc *sc) for (pri = 0; pri < RTW_NTXPRI; pri++) { tsb = &sc->sc_txsoft_blk[pri]; - free(tsb->tsb_desc, M_DEVBUF); + free(tsb->tsb_desc, M_DEVBUF, 0); tsb->tsb_desc = NULL; } } @@ -4073,7 +4073,7 @@ fail8: sr = &sc->sc_srom; sr->sr_size = 0; if (sr->sr_content != NULL) { - free(sr->sr_content, M_DEVBUF); + free(sr->sr_content, M_DEVBUF, 0); sr->sr_content = NULL; } diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c index 065699d339f..49be864def4 100644 --- a/sys/dev/ic/sili.c +++ b/sys/dev/ic/sili.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sili.c,v 1.51 2012/02/04 21:44:54 krw Exp $ */ +/* $OpenBSD: sili.c,v 1.52 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2007 David Gwynne @@ -772,7 +772,7 @@ sili_ports_alloc(struct sili_softc *sc) freeports: /* bus_space(9) says subregions dont have to be freed */ - free(sp, M_DEVBUF); + free(sp, M_DEVBUF, 0); sc->sc_ports = NULL; return (1); } @@ -791,7 +791,7 @@ sili_ports_free(struct sili_softc *sc) } /* bus_space(9) says subregions dont have to be freed */ - free(sc->sc_ports, M_DEVBUF); + free(sc->sc_ports, M_DEVBUF, 0); sc->sc_ports = NULL; } @@ -859,7 +859,7 @@ sili_ccb_free(struct sili_port *sp) while ((ccb = sili_get_ccb(sp)) != NULL) bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmamap); - free(sp->sp_ccbs, M_DEVBUF); + free(sp->sp_ccbs, M_DEVBUF, 0); sp->sp_ccbs = NULL; } @@ -943,7 +943,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_dmat, sdm->sdm_map); sdmfree: - free(sdm, M_DEVBUF); + free(sdm, M_DEVBUF, 0); return (NULL); } @@ -955,7 +955,7 @@ sili_dmamem_free(struct sili_softc *sc, struct sili_dmamem *sdm) bus_dmamem_unmap(sc->sc_dmat, sdm->sdm_kva, sdm->sdm_size); bus_dmamem_free(sc->sc_dmat, &sdm->sdm_seg, 1); bus_dmamap_destroy(sc->sc_dmat, sdm->sdm_map); - free(sdm, M_DEVBUF); + free(sdm, M_DEVBUF, 0); } u_int32_t diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c index 263db8e03af..d7d4a22d9b2 100644 --- a/sys/dev/ic/siop.c +++ b/sys/dev/ic/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.66 2013/05/27 21:19:31 miod Exp $ */ +/* $OpenBSD: siop.c,v 1.67 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */ /* @@ -299,7 +299,7 @@ siop_reset(sc) sc->sc_c.sc_dev.dv_xname, lunsw->lunsw_off); #endif TAILQ_REMOVE(&sc->lunsw_list, lunsw, next); - free(lunsw, M_DEVBUF); + free(lunsw, M_DEVBUF, 0); } TAILQ_INIT(&sc->lunsw_list); /* restore reselect switch */ @@ -312,7 +312,7 @@ siop_reset(sc) sc->sc_c.sc_dev.dv_xname, i); #endif target = (struct siop_target *)sc->sc_c.targets[i]; - free(target->lunsw, M_DEVBUF); + free(target->lunsw, M_DEVBUF, 0); target->lunsw = siop_get_lunsw(sc); if (target->lunsw == NULL) { printf("%s: can't alloc lunsw for target %d\n", @@ -1426,7 +1426,7 @@ siop_scsiprobe(struct scsi_link *link) if (siop_target->lunsw == NULL) { printf("%s: can't alloc lunsw for target %d\n", sc->sc_c.sc_dev.dv_xname, target); - free(siop_target, M_DEVBUF); + free(siop_target, M_DEVBUF, 0); return (ENOMEM); } for (i = 0; i < 8; i++) @@ -1952,9 +1952,9 @@ bad0: bad1: siop_dmamem_free(sc, newcbd->xfers); bad2: - free(newcbd->cmds, M_DEVBUF); + free(newcbd->cmds, M_DEVBUF, 0); bad3: - free(newcbd, M_DEVBUF); + free(newcbd, M_DEVBUF, 0); return; } @@ -2188,7 +2188,7 @@ siop_scsifree(struct scsi_link *link) #endif siop_target = (struct siop_target *)sc->sc_c.targets[target]; - free(siop_target->siop_lun[lun], M_DEVBUF); + free(siop_target->siop_lun[lun], M_DEVBUF, 0); siop_target->siop_lun[lun] = NULL; /* XXX compact sw entry too ? */ /* check if we can free the whole target */ @@ -2208,7 +2208,7 @@ siop_scsifree(struct scsi_link *link) siop_script_write(sc, siop_target->reseloff, 0x800c00ff); siop_script_sync(sc, BUS_DMASYNC_PREWRITE); TAILQ_INSERT_TAIL(&sc->lunsw_list, siop_target->lunsw, next); - free(sc->sc_c.targets[target], M_DEVBUF); + free(sc->sc_c.targets[target], M_DEVBUF, 0); sc->sc_c.targets[target] = NULL; sc->sc_ntargets--; } @@ -2265,7 +2265,7 @@ free: destroy: bus_dmamap_destroy(sc->sc_c.sc_dmat, sdm->sdm_map); sdmfree: - free(sdm, M_DEVBUF); + free(sdm, M_DEVBUF, 0); return (NULL); } @@ -2277,6 +2277,6 @@ siop_dmamem_free(struct siop_softc *sc, struct siop_dmamem *sdm) bus_dmamem_unmap(sc->sc_c.sc_dmat, sdm->sdm_kva, sdm->sdm_size); bus_dmamem_free(sc->sc_c.sc_dmat, &sdm->sdm_seg, 1); bus_dmamap_destroy(sc->sc_c.sc_dmat, sdm->sdm_map); - free(sdm, M_DEVBUF); + free(sdm, M_DEVBUF, 0); } diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index 12eafb47ddf..3f9ca8d30c7 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.71 2014/03/28 17:57:11 mpi Exp $ */ +/* $OpenBSD: sti.c,v 1.72 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -157,7 +157,7 @@ sti_attach_common(struct sti_softc *sc, bus_space_tag_t iot, rom->rom_softc = sc; rc = sti_rom_setup(rom, iot, memt, romh, sc->bases, codebase); if (rc != 0) { - free(rom, M_DEVBUF); + free(rom, M_DEVBUF, 0); return (rc); } @@ -189,7 +189,7 @@ sti_attach_screen(struct sti_softc *sc, int flags) scr->scr_rom = sc->sc_rom; rc = sti_screen_setup(scr, flags); if (rc != 0) { - free(scr, M_DEVBUF); + free(scr, M_DEVBUF, 0); return (NULL); } @@ -629,7 +629,7 @@ sti_screen_setup(struct sti_screen *scr, int flags) fail: /* XXX free resources */ if (scr->scr_ecfg.addr != NULL) { - free(scr->scr_ecfg.addr, M_DEVBUF); + free(scr->scr_ecfg.addr, M_DEVBUF, 0); scr->scr_ecfg.addr = NULL; } @@ -842,7 +842,7 @@ rescan: } } - free(scr->scr_romfont, M_DEVBUF); + free(scr->scr_romfont, M_DEVBUF, 0); scr->scr_romfont = NULL; } #endif diff --git a/sys/dev/ic/tcic2.c b/sys/dev/ic/tcic2.c index f04e378055f..52277af36d2 100644 --- a/sys/dev/ic/tcic2.c +++ b/sys/dev/ic/tcic2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcic2.c,v 1.10 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: tcic2.c,v 1.11 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: tcic2.c,v 1.3 2000/01/13 09:38:17 joda Exp $ */ #undef TCICDEBUG @@ -499,7 +499,7 @@ tcic_event_thread(arg) panic("tcic_event_thread: unknown event %d", pe->pe_type); } - free(pe, M_TEMP); + free(pe, M_TEMP, 0); } h->event_thread = NULL; diff --git a/sys/dev/ic/ti.c b/sys/dev/ic/ti.c index 4528c297dea..e547913cdf5 100644 --- a/sys/dev/ic/ti.c +++ b/sys/dev/ic/ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ti.c,v 1.7 2013/10/01 20:06:00 sf Exp $ */ +/* $OpenBSD: ti.c,v 1.8 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -436,7 +436,7 @@ ti_loadfw(struct ti_softc *sc) TI_FIRMWARE_MAJOR, TI_FIRMWARE_MINOR, TI_FIRMWARE_FIX, tf->FwReleaseMajor, tf->FwReleaseMinor, tf->FwReleaseFix); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); return; } ti_mem_write(sc, tf->FwTextAddr, tf->FwTextLen, @@ -448,7 +448,7 @@ ti_loadfw(struct ti_softc *sc) ti_mem_set(sc, tf->FwBssAddr, tf->FwBssLen); ti_mem_set(sc, tf->FwSbssAddr, tf->FwSbssLen); CSR_WRITE_4(sc, TI_CPU_PROGRAM_COUNTER, tf->FwStartAddr); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); } /* @@ -1048,7 +1048,7 @@ ti_free_tx_ring(struct ti_softc *sc) while ((entry = SLIST_FIRST(&sc->ti_tx_map_listhead))) { SLIST_REMOVE_HEAD(&sc->ti_tx_map_listhead, link); bus_dmamap_destroy(sc->sc_dmatag, entry->dmamap); - free(entry, M_DEVBUF); + free(entry, M_DEVBUF, 0); } } @@ -1187,7 +1187,7 @@ ti_iff(struct ti_softc *sc) mc = SLIST_FIRST(&sc->ti_mc_listhead); ti_del_mcast(sc, &mc->mc_addr); SLIST_REMOVE_HEAD(&sc->ti_mc_listhead, mc_entries); - free(mc, M_DEVBUF); + free(mc, M_DEVBUF, 0); } /* Now program new ones. */ diff --git a/sys/dev/ic/trm.c b/sys/dev/ic/trm.c index f49c8e98883..f8d6f64a3a5 100644 --- a/sys/dev/ic/trm.c +++ b/sys/dev/ic/trm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trm.c,v 1.31 2013/07/12 20:51:31 krw Exp $ +/* $OpenBSD: trm.c,v 1.32 2014/07/12 18:48:17 tedu Exp $ * ------------------------------------------------------------ * O.S : OpenBSD * File Name : trm.c @@ -2066,7 +2066,7 @@ trm_FinishSRB(struct trm_softc *sc, struct trm_scsi_req_q *pSRB) sc_print_addr(xs->sc_link); printf("trm_FinishSRB NO Device\n"); #endif - free(pDCB, M_DEVBUF); + free(pDCB, M_DEVBUF, 0); sc->pDCB[target][lun] = NULL; pDCB = NULL; diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 6a536b6bbf4..4561404e111 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.61 2013/10/20 21:24:00 miod Exp $ */ +/* $OpenBSD: vga.c,v 1.62 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -702,13 +702,13 @@ vga_free_screen(void *v, void *cookie) * removes backing store for the last one */ if (vc->nscreens == 1) - free(LIST_FIRST(&vc->screens)->pcs.mem, M_DEVBUF); + free(LIST_FIRST(&vc->screens)->pcs.mem, M_DEVBUF, 0); /* Last screen has no backing store */ if (vc->nscreens != 0) - free(vs->pcs.mem, M_DEVBUF); + free(vs->pcs.mem, M_DEVBUF, 0); - free(vs, M_DEVBUF); + free(vs, M_DEVBUF, 0); } else panic("vga_free_screen: console"); diff --git a/sys/dev/ic/wd33c93.c b/sys/dev/ic/wd33c93.c index 6aadfa2f0b7..946cf95f3cb 100644 --- a/sys/dev/ic/wd33c93.c +++ b/sys/dev/ic/wd33c93.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd33c93.c,v 1.6 2014/06/27 17:51:08 miod Exp $ */ +/* $OpenBSD: wd33c93.c,v 1.7 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: wd33c93.c,v 1.24 2010/11/13 13:52:02 uebayasi Exp $ */ /* @@ -813,7 +813,7 @@ wd33c93_scsidone(struct wd33c93_softc *sc, struct wd33c93_acb *acb, int status) if (li->untagged == NULL && li->used == 0) { if (sc_link->lun < SBIC_NLUN) ti->lun[sc_link->lun] = NULL; - free(li, M_DEVBUF); + free(li, M_DEVBUF, 0); li = NULL; } } @@ -2295,7 +2295,7 @@ wd33c93_watchdog(void *arg) if (li && li->last_used < old && li->untagged == NULL && li->used == 0) { ti->lun[li->lun] = NULL; - free(li, M_DEVBUF); + free(li, M_DEVBUF, 0); } splx(s); } diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index cb3a1fcc789..fc0a664bf78 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc.c,v 1.124 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: wdc.c,v 1.125 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -732,7 +732,7 @@ wdc_alloc_queue(void) void wdc_free_queue(struct channel_queue *queue) { - free(queue, M_DEVBUF); + free(queue, M_DEVBUF, 0); } void @@ -2144,7 +2144,7 @@ wdc_ioctl(struct ata_drive_datas *drvp, u_long xfer, caddr_t addr, int flag, if (log_to_copy != NULL) { error = copyout(log_to_copy, agt->buf, size); - free(log_to_copy, M_TEMP); + free(log_to_copy, M_TEMP, 0); } agt->bytes_copied = size; diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c index aa8f62d1edc..fd0aff8410a 100644 --- a/sys/dev/ipmi.c +++ b/sys/dev/ipmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipmi.c,v 1.71 2014/07/08 17:19:25 deraadt Exp $ */ +/* $OpenBSD: ipmi.c,v 1.72 2014/07/12 18:48:17 tedu Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave @@ -1026,7 +1026,7 @@ ipmi_sendcmd(struct ipmi_softc *sc, int rssa, int rslun, int netfn, int cmd, goto done; } rc = sc->sc_if->sendmsg(sc, txlen, buf); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); ipmi_delay(sc, 5); /* give bmc chance to digest command */ @@ -1066,7 +1066,7 @@ ipmi_recvcmd(struct ipmi_softc *sc, int maxlen, int *rxlen, void *data) *rxlen); dbg_dump(10, " recv", *rxlen, data); - free(buf, M_DEVBUF); + free(buf, M_DEVBUF, 0); ipmi_delay(sc, 5); /* give bmc chance to digest command */ @@ -1156,14 +1156,14 @@ get_sdr(struct ipmi_softc *sc, u_int16_t recid, u_int16_t *nxtrec) psdr + offset, NULL)) { printf("%s: get chunk: %d,%d fails\n", DEVNAME(sc), offset, len); - free(psdr, M_DEVBUF); + free(psdr, M_DEVBUF, 0); return (1); } } /* Add SDR to sensor list, if not wanted, free buffer */ if (add_sdr_sensor(sc, psdr) == 0) - free(psdr, M_DEVBUF); + free(psdr, M_DEVBUF, 0); return (0); } diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c index 7527427742a..e159e700bd7 100644 --- a/sys/dev/isa/fd.c +++ b/sys/dev/isa/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.99 2014/06/15 11:43:24 sf Exp $ */ +/* $OpenBSD: fd.c,v 1.100 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */ /*- @@ -1014,7 +1014,7 @@ fdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); fdgetdisklabel(dev, fd, lp, 0); bcopy(lp, fd->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP); + free(lp, M_TEMP, 0); return 0; case DIOCGPDINFO: @@ -1113,6 +1113,6 @@ fdformat(dev_t dev, struct fd_formb *finfo, struct proc *p) /* ...and wait for it to complete */ rv = biowait(bp); - free(bp, M_TEMP); + free(bp, M_TEMP, 0); return (rv); } diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index 1fa77ae8833..4358c94b90d 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gus.c,v 1.39 2013/11/15 16:46:27 brad Exp $ */ +/* $OpenBSD: gus.c,v 1.40 2014/07/12 18:48:17 tedu Exp $ */ /* $NetBSD: gus.c,v 1.51 1998/01/25 23:48:06 mycroft Exp $ */ /*- @@ -618,7 +618,7 @@ gusclose(void *addr) sc->sc_flags &= ~(GUS_OPEN|GUS_LOCKED|GUS_DMAOUT_ACTIVE|GUS_DMAIN_ACTIVE); if (sc->sc_deintr_buf) { - free(sc->sc_deintr_buf, M_DEVBUF); + free(sc->sc_deintr_buf, M_DEVBUF, 0); sc->sc_deintr_buf = NULL; } /* turn off speaker, etc. */ @@ -1579,7 +1579,7 @@ gus_round_blocksize(addr, blocksize) /* set up temporary buffer to hold the deinterleave, if necessary for stereo output */ if (sc->sc_deintr_buf) { - free(sc->sc_deintr_buf, M_DEVBUF); + free(sc->sc_deintr_buf, M_DEVBUF, 0); sc->sc_deintr_buf = NULL; } sc->sc_deintr_buf = malloc(blocksize/2, M_DEVBUF, M_WAITOK); diff --git a/sys/dev/isa/isa.c b/sys/dev/isa/isa.c index f817620e328..5def3845b83 100644 --- a/sys/dev/isa/isa.c +++ b/sys/dev/isa/isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isa.c,v 1.41 2013/05/30 16:15:02 deraadt Exp $ */ +/* $OpenBSD: isa.c,v 1.42 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: isa.c,v 1.85 1996/05/14 00:31:04 thorpej Exp $ */ /* @@ -240,7 +240,7 @@ isascan(parent, match) if (autoconf_verbose) printf(">>> probing for %s* finished\n", cf->cf_driver->cd_name); - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); return; } @@ -253,7 +253,7 @@ isascan(parent, match) !isa_intr_check(sc->sc_ic, ia.ia_irq, IST_EDGE)) { printf("%s%d: irq %d already in use\n", cf->cf_driver->cd_name, cf->cf_unit, ia.ia_irq); - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); } else { #endif if (autoconf_verbose) @@ -274,7 +274,7 @@ isascan(parent, match) if (autoconf_verbose) printf(">>> probing for %s%d failed\n", cf->cf_driver->cd_name, cf->cf_unit); - free(dev, M_DEVBUF); + free(dev, M_DEVBUF, 0); } } diff --git a/sys/dev/isa/isadma.c b/sys/dev/isa/isadma.c index 0099c74c9d7..74b73896a44 100644 --- a/sys/dev/isa/isadma.c +++ b/sys/dev/isa/isadma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isadma.c,v 1.31 2008/06/26 05:42:16 ray Exp $ */ +/* $OpenBSD: isadma.c,v 1.32 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: isadma.c,v 1.32 1997/09/05 01:48:33 thorpej Exp $ */ /*- @@ -719,7 +719,7 @@ isa_free(addr, pool) *mp = m->next; isa_dmamem_unmap(m->isadev, m->chan, kva, m->size); isa_dmamem_free(m->isadev, m->chan, m->addr, m->size); - free(m, pool); + free(m, pool, 0); } paddr_t diff --git a/sys/dev/isa/isapnp.c b/sys/dev/isa/isapnp.c index c29feb8c056..2b5911aec54 100644 --- a/sys/dev/isa/isapnp.c +++ b/sys/dev/isa/isapnp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isapnp.c,v 1.40 2011/06/29 12:17:40 tedu Exp $ */ +/* $OpenBSD: isapnp.c,v 1.41 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: isapnp.c,v 1.9.4.3 1997/10/29 00:40:43 thorpej Exp $ */ /* @@ -427,7 +427,7 @@ isapnp_bestconfig(isa, sc, ipa) return best; } - free(best, M_DEVBUF); + free(best, M_DEVBUF, 0); continue; } else { @@ -439,7 +439,7 @@ isapnp_bestconfig(isa, sc, ipa) continue; d = c->ipa_sibling; if (SAMEDEV(c, best)) - free(c, M_DEVBUF); + free(c, M_DEVBUF, 0); else { if (n) n->ipa_sibling = c; @@ -923,7 +923,7 @@ isapnp_attach(parent, self, aux) if (lpa->ipa_pref == ISAPNP_DEP_CONFLICTING) { isapnp_print(lpa, self->dv_xname); printf(" resource conflict\n"); - free(lpa, M_DEVBUF); + free(lpa, M_DEVBUF, 0); continue; } @@ -948,7 +948,7 @@ isapnp_attach(parent, self, aux) printf(" not configured\n"); isapnp_write_reg(sc, ISAPNP_ACTIVATE, 0); } - free(lpa, M_DEVBUF); + free(lpa, M_DEVBUF, 0); } isapnp_write_reg(sc, ISAPNP_WAKE, 0); /* Good night cards */ } diff --git a/sys/dev/isa/isapnpres.c b/sys/dev/isa/isapnpres.c index a45b0c654e4..5c5a82beb18 100644 --- a/sys/dev/isa/isapnpres.c +++ b/sys/dev/isa/isapnpres.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isapnpres.c,v 1.8 2013/11/15 16:46:27 brad Exp $ */ +/* $OpenBSD: isapnpres.c,v 1.9 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: isapnpres.c,v 1.7.4.1 1997/11/20 07:46:13 mellon Exp $ */ /* @@ -177,7 +177,7 @@ isapnp_flatten(struct isa_attach_args *card) struct isa_attach_args *dev, *conf, *d, *c, *pa; dev = card->ipa_child; - free(card, M_DEVBUF); + free(card, M_DEVBUF, 0); for (conf = c = NULL, d = dev; d; d = dev) { dev = d->ipa_sibling; @@ -198,7 +198,7 @@ isapnp_flatten(struct isa_attach_args *card) isapnp_merge(pa, d); pa = d->ipa_child; - free(d, M_DEVBUF); + free(d, M_DEVBUF, 0); } if (c == NULL) @@ -514,7 +514,7 @@ parse: bad: for (card = isapnp_flatten(card); card; ) { dev = card->ipa_sibling; - free(card, M_DEVBUF); + free(card, M_DEVBUF, 0); card = dev; } printf("%s: %s, card %d\n", sc->sc_dev.dv_xname, diff --git a/sys/dev/isa/spkr.c b/sys/dev/isa/spkr.c index 8e9d022fe2a..085eb98a769 100644 --- a/sys/dev/isa/spkr.c +++ b/sys/dev/isa/spkr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spkr.c,v 1.15 2014/07/10 14:21:20 deraadt Exp $ */ +/* $OpenBSD: spkr.c,v 1.16 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: spkr.c,v 1.1 1998/04/15 20:26:18 drochner Exp $ */ /* @@ -452,7 +452,7 @@ spkrclose(dev_t dev, int flags, int mode, struct proc *p) return (ENXIO); else { tone(0, 0); - free(spkr_inbuf, M_DEVBUF); + free(spkr_inbuf, M_DEVBUF, 0); spkr_active = 0; } return (0); diff --git a/sys/dev/microcode/aic7xxx/aicasm_symbol.c b/sys/dev/microcode/aic7xxx/aicasm_symbol.c index 7b3c2a8f3a0..3474ec074c0 100644 --- a/sys/dev/microcode/aic7xxx/aicasm_symbol.c +++ b/sys/dev/microcode/aic7xxx/aicasm_symbol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aicasm_symbol.c,v 1.11 2012/12/05 23:20:19 deraadt Exp $ */ +/* $OpenBSD: aicasm_symbol.c,v 1.12 2014/07/12 18:48:18 tedu Exp $ */ /* $NetBSD: aicasm_symbol.c,v 1.4 2003/07/14 15:42:40 lukem Exp $ */ /* @@ -96,11 +96,11 @@ symbol_delete(symbol_t *symbol) case SRAMLOC: case REGISTER: if (symbol->info.rinfo != NULL) - free(symbol->info.rinfo); + free(symbol->info.rinfo, 0); break; case ALIAS: if (symbol->info.ainfo != NULL) - free(symbol->info.ainfo); + free(symbol->info.ainfo, 0); break; case MASK: case FIELD: @@ -108,24 +108,24 @@ symbol_delete(symbol_t *symbol) case ENUM_ENTRY: if (symbol->info.finfo != NULL) { symlist_free(&symbol->info.finfo->symrefs); - free(symbol->info.finfo); + free(symbol->info.finfo, 0); } break; case DOWNLOAD_CONST: case CONST: if (symbol->info.cinfo != NULL) - free(symbol->info.cinfo); + free(symbol->info.cinfo, 0); break; case LABEL: if (symbol->info.linfo != NULL) - free(symbol->info.linfo); + free(symbol->info.linfo, 0); break; case UNINITIALIZED: default: break; } - free(symbol->name); - free(symbol); + free(symbol->name, 0); + free(symbol, 0); } void @@ -299,7 +299,7 @@ symlist_free(symlist_t *symlist) node1 = SLIST_FIRST(symlist); while (node1 != NULL) { node2 = SLIST_NEXT(node1, links); - free(node1); + free(node1, 0); node1 = node2; } SLIST_INIT(symlist); @@ -632,7 +632,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define%s%-16s%s0x%02x\n", tab_str, curnode->symbol->name, tab_str2, value); - free(curnode); + free(curnode, 0); } fprintf(ofile, "\n\n"); @@ -644,7 +644,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.cinfo->value); - free(curnode); + free(curnode, 0); } @@ -658,7 +658,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.cinfo->value); - free(curnode); + free(curnode, 0); } fprintf(ofile, "#define\tDOWNLOAD_CONST_COUNT\t0x%02x\n", i); @@ -672,7 +672,7 @@ symtable_dump(FILE *ofile, FILE *dfile) fprintf(ofile, "#define\tLABEL_%-8s\t0x%02x\n", curnode->symbol->name, curnode->symbol->info.linfo->address); - free(curnode); + free(curnode, 0); } } diff --git a/sys/dev/microcode/bnx/build.c b/sys/dev/microcode/bnx/build.c index 06ed4d89aff..47e62305bc7 100644 --- a/sys/dev/microcode/bnx/build.c +++ b/sys/dev/microcode/bnx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.5 2009/07/03 04:34:51 dlg Exp $ */ +/* $OpenBSD: build.c,v 1.6 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -297,7 +297,7 @@ main(int argc, char *argv[]) write_firmware(FILENAME_B09, bf, sizeof(*bf), chunks_b09, nitems(chunks_b09)); - free(bf); + free(bf, 0); rh = (struct bnx_rv2p_header *)malloc(sizeof *rh); @@ -328,7 +328,7 @@ main(int argc, char *argv[]) write_firmware(FILENAME_XI90_RV2P, rh, sizeof(*rh), chunks_xi90_rv2p, nitems(chunks_xi90_rv2p)); - free(rh); + free(rh, 0); return 0; } diff --git a/sys/dev/microcode/bwi/build/build.c b/sys/dev/microcode/bwi/build/build.c index d93be003090..e286e82f3a3 100644 --- a/sys/dev/microcode/bwi/build/build.c +++ b/sys/dev/microcode/bwi/build/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.1 2007/10/04 17:46:09 mglocker Exp $ */ +/* $OpenBSD: build.c,v 1.2 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2006 Marcus Glocker @@ -131,18 +131,18 @@ main(int argc, char *argv[]) err(1, "malloc"); } if (read(fdin, p, h[i].filesize) < 1) { - free(p); + free(p, 0); close(fdout); close(fdin); err(1, "read input file failed\n"); } if (write(fdout, p, h[i].filesize) < 1) { - free(p); + free(p, 0); close(fdout); close(fdin); err(1, "write to output file failed\n"); } - free(p); + free(p, 0); close(fdin); } diff --git a/sys/dev/microcode/bwi/extract/extract.c b/sys/dev/microcode/bwi/extract/extract.c index 2aee0d8aea5..0c91ab8ebee 100644 --- a/sys/dev/microcode/bwi/extract/extract.c +++ b/sys/dev/microcode/bwi/extract/extract.c @@ -1,4 +1,4 @@ -/* $OpenBSD: extract.c,v 1.1 2007/10/04 17:46:09 mglocker Exp $ */ +/* $OpenBSD: extract.c,v 1.2 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2006 Marcus Glocker @@ -85,7 +85,7 @@ main(int argc, char *argv[]) err(1, "read from input file failed"); if (write(fdout, p, h[i]->filesize) < 1) err(1, "write to output file failed"); - free(p); + free(p, 0); close(fdout); printf("extracting %s (filesize %d, fileoffset %d)\n", h[i]->filename, h[i]->filesize, h[i]->fileoffset); @@ -93,8 +93,8 @@ main(int argc, char *argv[]) /* free header space */ for (i = 0; i < nfiles; i++) - free(h[i]); - free(h); + free(h[i], 0); + free(h, 0); /* game over */ close (fdin); diff --git a/sys/dev/microcode/kue/build.c b/sys/dev/microcode/kue/build.c index aaf8003279e..55f06583419 100644 --- a/sys/dev/microcode/kue/build.c +++ b/sys/dev/microcode/kue/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.4 2007/01/09 16:30:06 deraadt Exp $ */ +/* $OpenBSD: build.c,v 1.5 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -65,7 +65,7 @@ main(int argc, char *argv[]) err(1, "%s", FILENAME); if (rlen != len) errx(1, "%s: short write", FILENAME); - free(kf); + free(kf, 0); close(fd); return 0; } diff --git a/sys/dev/microcode/myx/build.c b/sys/dev/microcode/myx/build.c index 7a12c39593a..a66764250fb 100644 --- a/sys/dev/microcode/myx/build.c +++ b/sys/dev/microcode/myx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.2 2011/07/08 03:58:27 dlg Exp $ */ +/* $OpenBSD: build.c,v 1.3 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2007 Reyk Floeter @@ -82,7 +82,7 @@ myx_build_firmware(u_int8_t *fw, size_t len, size_t ulen, const char *file) } while (total < ulen); printf("%s: len %zu -> %zu\n", file, len, ulen); - free(ufw); + free(ufw, 0); fclose(f); } diff --git a/sys/dev/microcode/tigon/build.c b/sys/dev/microcode/tigon/build.c index 5498eecb381..048de9c3674 100644 --- a/sys/dev/microcode/tigon/build.c +++ b/sys/dev/microcode/tigon/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.6 2009/08/29 22:53:23 kettenis Exp $ */ +/* $OpenBSD: build.c,v 1.7 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -95,7 +95,7 @@ output(const char *name, err(1, "%s", name); if (rlen != len) errx(1, "%s: short write", name); - free(tf); + free(tf, 0); close(fd); } diff --git a/sys/dev/microcode/yds/build.c b/sys/dev/microcode/yds/build.c index 1dfd81ffcf0..392a250803e 100644 --- a/sys/dev/microcode/yds/build.c +++ b/sys/dev/microcode/yds/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.4 2007/01/06 02:48:42 deraadt Exp $ */ +/* $OpenBSD: build.c,v 1.5 2014/07/12 18:48:18 tedu Exp $ */ /* * Copyright (c) 2004 Theo de Raadt @@ -81,7 +81,7 @@ main(int argc, char *argv[]) err(1, "%s", FILENAME); if (rlen != len) errx(1, "%s: short write", FILENAME); - free(yf); + free(yf, 0); close(fd); return 0; }