summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2018-01-11 15:49:35 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2018-01-11 15:49:35 +0000
commit02d7e6045f2a185a4090f36cf0f8ca274e154154 (patch)
tree6618235f35952170094b03ca41ed2a53209e57f3 /sys/arch/arm64
parent5d3e457eb312fff2f8ceb888863de3cdc6062e3e (diff)
Add size for free.
OK mpi@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r--sys/arch/arm64/arm64/bus_dma.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/arm64/arm64/bus_dma.c b/sys/arch/arm64/arm64/bus_dma.c
index 74876fe04e6..fe1671adf97 100644
--- a/sys/arch/arm64/arm64/bus_dma.c
+++ b/sys/arch/arm64/arm64/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.9 2017/08/11 22:01:09 kettenis Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.10 2018/01/11 15:49:34 visa Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -115,7 +115,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);
}
/*