Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jun 2013 11:42:47 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251221 - head/sys/kern
Message-ID:  <201306011142.r51BglSK070027@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sat Jun  1 11:42:47 2013
New Revision: 251221
URL: http://svnweb.freebsd.org/changeset/base/251221

Log:
  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

Modified:
  head/sys/kern/subr_bus_dma.c

Modified: head/sys/kern/subr_bus_dma.c
==============================================================================
--- head/sys/kern/subr_bus_dma.c	Sat Jun  1 11:31:09 2013	(r251220)
+++ head/sys/kern/subr_bus_dma.c	Sat Jun  1 11:42:47 2013	(r251221)
@@ -104,8 +104,6 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d
 	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_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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306011142.r51BglSK070027>