diff options
author | grehan <grehan@FreeBSD.org> | 2005-07-09 06:53:52 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2005-07-09 06:53:52 +0000 |
commit | 671f52d9b82d3e4e0ba4a11c6d1f24460b9a4b77 (patch) | |
tree | 777f8f7e3cb5dd2813c7f06dc67da30da49d264a | |
parent | 546c2464a37750c6bc9fdb48917559d308ff5f20 (diff) | |
download | FreeBSD-src-671f52d9b82d3e4e0ba4a11c6d1f24460b9a4b77.zip FreeBSD-src-671f52d9b82d3e4e0ba4a11c6d1f24460b9a4b77.tar.gz |
The nsegs parameter to bus_dmamap_load_mbuf_sg is not required to
be set to 0 on input. This caused a panic in an an MP test version
of the GEM driver from Marius, and from inspection of other PCI
drivers, the same problem would happen there.
Fix by explicitly setting to 0.
Approved by: re
-rw-r--r-- | sys/powerpc/powerpc/busdma_machdep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c index 88a0548..2fe0a6d 100644 --- a/sys/powerpc/powerpc/busdma_machdep.c +++ b/sys/powerpc/powerpc/busdma_machdep.c @@ -508,6 +508,8 @@ bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0, M_ASSERTPKTHDR(m0); + *nsegs = 0; + if (m0->m_pkthdr.len <= dmat->maxsize) { int first = 1; vm_offset_t lastaddr = 0; |