diff options
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); } /* |