summaryrefslogtreecommitdiff
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index c5c67267ef6f..b493702186eb 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1243,6 +1243,7 @@ crfree(cr)
{
mtx_lock(&cr->cr_mtx);
+ KASSERT(cr->cr_ref > 0, ("bad ucred refcount: %d", cr->cr_ref));
if (--cr->cr_ref == 0) {
mtx_destroy(&cr->cr_mtx);
/*