diff options
-rw-r--r-- | sys/kern/subr_witness.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 0453c93..47642b9 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -556,14 +556,6 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) lock_list = PCPU_PTR(spinlocks); /* - * Try locks do not block if they fail to acquire the lock, thus - * there is no danger of deadlocks or of switching while holding a - * spin lock if we acquire a lock via a try operation. - */ - if (flags & LOP_TRYLOCK) - goto out; - - /* * Is this the first lock acquired? If so, then no order checking * is needed. */ @@ -609,6 +601,14 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line) } /* + * Try locks do not block if they fail to acquire the lock, thus + * there is no danger of deadlocks or of switching while holding a + * spin lock if we acquire a lock via a try operation. + */ + if (flags & LOP_TRYLOCK) + goto out; + + /* * Check for duplicate locks of the same type. Note that we only * have to check for this on the last lock we just acquired. Any * other cases will be caught as lock order violations. |