From cd1692fa5d70ce770ff50cce54013418b8ce0921 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Mon, 11 Aug 2014 15:06:07 +0000 Subject: [PATCH] Move KASSERT into locked region. Submitted by: kib --- sys/kern/subr_sfbuf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_sfbuf.c b/sys/kern/subr_sfbuf.c index cdf19da98dd9..707ace220639 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); }