Move an assertion to the right spot; only bus_dmamap_load_mbuf(9)

requires a pkthdr being present but that's not the case for either
_bus_dmamap_load_mbuf_sg() or bus_dmamap_load_mbuf_sg(9).

Reported by:	sbruno
MFC after:	1 week
This commit is contained in:
Marius Strobl 2013-06-01 11:42:47 +00:00
parent f112d4f8b7
commit 0ad17e4b32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251221

View File

@ -104,8 +104,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
struct mbuf *m;
int error;
M_ASSERTPKTHDR(m0);
error = 0;
for (m = m0; m != NULL && error == 0; m = m->m_next) {
if (m->m_len > 0) {
@ -323,6 +321,8 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
bus_dma_segment_t *segs;
int nsegs, error;
M_ASSERTPKTHDR(m0);
flags |= BUS_DMA_NOWAIT;
nsegs = -1;
error = _bus_dmamap_load_mbuf_sg(dmat, map, m0, NULL, &nsegs, flags);