svn commit: r255614 - head/sys/powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Mon Sep 16 14:32:57 UTC 2013
Author: nwhitehorn
Date: Mon Sep 16 14:32:56 2013
New Revision: 255614
URL: http://svnweb.freebsd.org/changeset/base/255614
Log:
Fix bug in busdma: if segs is a preexisting buffer, we memcpy it
into the DMA map. The length of the buffer had not yet been
initialized, however, so this would copy gibberish unless it
happened to be right by chance. This bug mostly only affected
systems with IOMMUs.
Approved by: re (gjb)
MFC after: 3 days
Modified:
head/sys/powerpc/powerpc/busdma_machdep.c
Modified: head/sys/powerpc/powerpc/busdma_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/busdma_machdep.c Mon Sep 16 10:46:58 2013 (r255613)
+++ head/sys/powerpc/powerpc/busdma_machdep.c Mon Sep 16 14:32:56 2013 (r255614)
@@ -844,11 +844,11 @@ _bus_dmamap_complete(bus_dma_tag_t dmat,
bus_dma_segment_t *segs, int nsegs, int error)
{
+ map->nsegs = nsegs;
if (segs != NULL)
memcpy(map->segments, segs, map->nsegs*sizeof(segs[0]));
else
segs = map->segments;
- map->nsegs = nsegs;
if (dmat->iommu != NULL)
IOMMU_MAP(dmat->iommu, map->segments, &map->nsegs,
dmat->lowaddr, dmat->highaddr, dmat->alignment,
More information about the svn-src-all
mailing list