diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index e869bafc96b8..318f81fb13be 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -1741,8 +1741,8 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) prison_hold(pr); refcount_acquire(&pr->pr_uref); } else { - refcount_release(&pr->pr_uref); refcount_release(&pr->pr_ref); + drflags |= PD_DEUREF; } } pr->pr_flags = (pr->pr_flags & ~ch_flags) | pr_flags;