summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-12-17 17:16:05 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-12-17 17:16:05 +0000
commit669b0af03e15b3cc00306d77579b1d0d3ce2a7c3 (patch)
tree61c8efddeb7b086aa97da2c57fd7675e5d7b38c5 /sys/arch/i386
parente20a72bd984f169efe4ef771d37cbfe3c5323d38 (diff)
add a size to free. from Mathieu
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/bus_dma.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c
index 5026980388c..0412ea6dcfa 100644
--- a/sys/arch/i386/i386/bus_dma.c
+++ b/sys/arch/i386/i386/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.34 2015/01/24 15:13:55 kettenis Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.35 2015/12/17 17:16:04 tedu Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -131,8 +131,11 @@ _bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments,
void
_bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map)
{
-
- free(map, M_DEVBUF, 0);
+ size_t mapsize;
+
+ mapsize = sizeof(struct bus_dmamap) +
+ (sizeof(bus_dma_segment_t) * (map->_dm_segcnt - 1));
+ free(map, M_DEVBUF, mapsize);
}
/*