diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-28 00:03:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-08-28 00:03:55 +0000 |
commit | 5ad0e8c0aeab06cc8ce3a15ee37adfe7cc17c615 (patch) | |
tree | 4c6488a821b9d519bda84a6732552a136bbdbd76 /sys/dev/cardbus | |
parent | 345b5260c0d266903c3e0fe179df2a1d3c10a5dc (diff) |
fairly simple sizes for free(); ok tedu
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 10 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbus_exrom.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 97ed93150b1..5af8aed42f3 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cardbus.c,v 1.50 2015/03/14 03:38:47 jsg Exp $ */ +/* $OpenBSD: cardbus.c,v 1.51 2015/08/28 00:03:53 deraadt Exp $ */ /* $NetBSD: cardbus.c,v 1.24 2000/04/02 19:11:37 mycroft Exp $ */ /* @@ -237,7 +237,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, 0); + free(p, M_DEVBUF, sizeof(*p)); } exrom = pci_conf_read(pc, tag, reg); pci_conf_write(pc, tag, reg, exrom & ~1); @@ -532,7 +532,7 @@ cardbus_attach_card(struct cardbus_softc *sc) /* do not match */ disable_function(sc, function); sc->sc_funcs[function] = NULL; - free(ct, M_DEVBUF, 0); + free(ct, M_DEVBUF, sizeof(struct cardbus_devfunc)); } else { /* found */ ct->ct_device = csc; @@ -544,7 +544,7 @@ cardbus_attach_card(struct cardbus_softc *sc) * if no functions were attached). */ disable_function(sc, 8); - free(tuple, M_TEMP, 0); + free(tuple, M_TEMP, 2048); return (no_work_funcs); } @@ -617,7 +617,7 @@ cardbus_detach_card(struct cardbus_softc *sc) } else { sc->sc_poweron_func &= ~(1 << ct->ct_func); sc->sc_funcs[ct->ct_func] = NULL; - free(ct, M_DEVBUF, 0); + free(ct, M_DEVBUF, sizeof(struct cardbus_devfunc)); } } diff --git a/sys/dev/cardbus/cardbus_exrom.c b/sys/dev/cardbus/cardbus_exrom.c index ee1b27ea952..607ad6244e3 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.6 2014/07/12 18:48:17 tedu Exp $ */ +/* $OpenBSD: cardbus_exrom.c,v 1.7 2015/08/28 00:03:53 deraadt 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, 0); + free(image, M_DEVBUF, sizeof(*image)); return (1); } SIMPLEQ_INSERT_TAIL(head, image, next); |