summaryrefslogtreecommitdiffstats
path: root/sys/dev/ti
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2000-07-08 00:14:12 +0000
committergallatin <gallatin@FreeBSD.org>2000-07-08 00:14:12 +0000
commit27334af100519b6a9465d2dc1ba716ac6bd37ccb (patch)
tree55998b8af2679a91af220cea11d3565ed7133384 /sys/dev/ti
parentefb639324d91add439f24a49689fdc12cdecd182 (diff)
downloadFreeBSD-src-27334af100519b6a9465d2dc1ba716ac6bd37ccb.zip
FreeBSD-src-27334af100519b6a9465d2dc1ba716ac6bd37ccb.tar.gz
use contigfree() rather than free() to free memory allocated with
contigmalloc(). reviewed by: wpaul
Diffstat (limited to 'sys/dev/ti')
-rw-r--r--sys/dev/ti/if_ti.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c
index 54d7a86..92525bc 100644
--- a/sys/dev/ti/if_ti.c
+++ b/sys/dev/ti/if_ti.c
@@ -630,7 +630,8 @@ static int ti_alloc_jumbo_mem(sc)
entry = malloc(sizeof(struct ti_jpool_entry),
M_DEVBUF, M_NOWAIT);
if (entry == NULL) {
- free(sc->ti_cdata.ti_jumbo_buf, M_DEVBUF);
+ contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM,
+ M_DEVBUF);
sc->ti_cdata.ti_jumbo_buf = NULL;
printf("ti%d: no memory for jumbo "
"buffer queue!\n", sc->ti_unit);
@@ -1681,7 +1682,8 @@ static int ti_attach(dev)
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq);
bus_release_resource(dev, SYS_RES_MEMORY,
TI_PCI_LOMEM, sc->ti_res);
- free(sc->ti_rdata, M_DEVBUF);
+ contigfree(sc->ti_rdata, sizeof(struct ti_ring_data),
+ M_DEVBUF);
error = ENXIO;
goto fail;
}
@@ -1752,8 +1754,8 @@ static int ti_detach(dev)
bus_release_resource(dev, SYS_RES_IRQ, 0, sc->ti_irq);
bus_release_resource(dev, SYS_RES_MEMORY, TI_PCI_LOMEM, sc->ti_res);
- free(sc->ti_cdata.ti_jumbo_buf, M_DEVBUF);
- free(sc->ti_rdata, M_DEVBUF);
+ contigfree(sc->ti_cdata.ti_jumbo_buf, TI_JMEM, M_DEVBUF);
+ contigfree(sc->ti_rdata, sizeof(struct ti_ring_data), M_DEVBUF);
ifmedia_removeall(&sc->ifmedia);
splx(s);
OpenPOWER on IntegriCloud