diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-01-11 15:49:35 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-01-11 15:49:35 +0000 |
commit | 02d7e6045f2a185a4090f36cf0f8ca274e154154 (patch) | |
tree | 6618235f35952170094b03ca41ed2a53209e57f3 /sys/arch/octeon | |
parent | 5d3e457eb312fff2f8ceb888863de3cdc6062e3e (diff) |
Add size for free.
OK mpi@
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r-- | sys/arch/octeon/octeon/bus_dma.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/octeon/octeon/bus_dma.c b/sys/arch/octeon/octeon/bus_dma.c index 5c14b454350..7d8943f15d0 100644 --- a/sys/arch/octeon/octeon/bus_dma.c +++ b/sys/arch/octeon/octeon/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.15 2017/04/15 04:38:27 visa Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.16 2018/01/11 15:49:34 visa Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -117,7 +117,11 @@ _dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, void _dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) { - free(map, M_DEVBUF, 0); + size_t mapsize; + + mapsize = sizeof(struct machine_bus_dmamap) + + (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1)); + free(map, M_DEVBUF, mapsize); } /* |