aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xen/netfront/netfront.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2009-05-27 01:56:37 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2009-05-27 01:56:37 +0000
commit2d8fae9867a6f42d4fcc6b9b40598e3d45620617 (patch)
tree459f78c06d4661baacca60c90fa73d1421a56b40 /sys/dev/xen/netfront/netfront.c
parentc099cafa14cde4cc6f7e414899fa23fcaf3188e9 (diff)
downloadsrc-2d8fae9867a6f42d4fcc6b9b40598e3d45620617.tar.gz
src-2d8fae9867a6f42d4fcc6b9b40598e3d45620617.zip
Do the invariant check before the mbuf is dereferenced.
Notes
Notes: svn path=/head/; revision=192870
Diffstat (limited to 'sys/dev/xen/netfront/netfront.c')
-rw-r--r--sys/dev/xen/netfront/netfront.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 282b1d7e5a60..6b1a2bf52730 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -1065,6 +1065,8 @@ xn_txeof(struct netfront_info *np)
id = txr->id;
m = np->xn_cdata.xn_tx_chain[id];
+ KASSERT(m != NULL, ("mbuf not found in xn_tx_chain"));
+ M_ASSERTVALID(m);
/*
* Increment packet count if this is the last
@@ -1072,8 +1074,6 @@ xn_txeof(struct netfront_info *np)
*/
if (!m->m_next)
ifp->if_opackets++;
- KASSERT(m != NULL, ("mbuf not found in xn_tx_chain"));
- M_ASSERTVALID(m);
if (unlikely(gnttab_query_foreign_access(
np->grant_tx_ref[id]) != 0)) {
printf("network_tx_buf_gc: warning "