summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
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);
}
/*