summaryrefslogtreecommitdiff
path: root/sys/kern/subr_witness.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r--sys/kern/subr_witness.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 099828de4d63..394d1a784041 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -848,10 +848,10 @@ witness_unlock(struct lock_object *lock, int flags, const char *file, int line)
td->td_proc->p_pid,
instance->li_lock->lo_name,
(*lock_list)->ll_count - 1);
- (*lock_list)->ll_count--;
- for (j = i; j < (*lock_list)->ll_count; j++)
+ for (j = i; j < (*lock_list)->ll_count - 1; j++)
(*lock_list)->ll_children[j] =
(*lock_list)->ll_children[j + 1];
+ (*lock_list)->ll_count--;
intr_restore(s);
if ((*lock_list)->ll_count == 0) {
lle = *lock_list;