summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-08-11 15:06:07 +0000
committerglebius <glebius@FreeBSD.org>2014-08-11 15:06:07 +0000
commit674240e02039a6feb14e2496e939c6cb80df9341 (patch)
tree5a8e6221b5a43be3cd7b8a59028f14a825528220
parentb20344b2e91bf1c2d0f5e2a8bba517ac86e48975 (diff)
downloadFreeBSD-src-674240e02039a6feb14e2496e939c6cb80df9341.zip
FreeBSD-src-674240e02039a6feb14e2496e939c6cb80df9341.tar.gz
Move KASSERT into locked region.
Submitted by: kib
-rw-r--r--sys/kern/subr_sfbuf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/subr_sfbuf.c b/sys/kern/subr_sfbuf.c
index cdf19da..707ace2 100644
--- a/sys/kern/subr_sfbuf.c
+++ b/sys/kern/subr_sfbuf.c
@@ -209,9 +209,8 @@ sf_buf_ref(struct sf_buf *sf)
return;
#endif
- KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf));
-
mtx_lock(&sf_buf_lock);
+ KASSERT(sf->ref_count > 0, ("%s: sf %p not allocated", __func__, sf));
sf->ref_count++;
mtx_unlock(&sf_buf_lock);
}
OpenPOWER on IntegriCloud