diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 9e47e4e8331f..0a3052c0eca5 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -185,9 +185,9 @@ uiomove(void *cp, int n, struct uio *uio) n -= cnt; } out: - if (td) { + if (td && save == 0) { mtx_lock_spin(&sched_lock); - td->td_flags = (td->td_flags & ~TDF_DEADLKTREAT) | save; + td->td_flags &= ~TDF_DEADLKTREAT; mtx_unlock_spin(&sched_lock); } return (error);