net/sched/cls_api.c:1270:3: warning: releasing mutex 'block->lock' that was not held [-Wthread-safety-analysis]
mutex_unlock(&block->lock);
^
net/sched/cls_api.c:1284:1: warning: mutex 'block->lock' is not held on every path through here [-Wthread-safety-analysis]
}
^
net/sched/cls_api.c:1261:6: note: mutex acquired here
if (refcount_dec_and_mutex_lock(&block->refcnt, &block->lock)) {
^
2 warnings generated.
_tcf_block_put first tries to obtain the lock with refcount_dec_and_mutex_lock, which is annotated with __try_acquires_mutex(true, lock), and then unlocks this mutex later on, or it does not get the lock and does nothing further with the lock.
This might need a small example to see if clang thread safety analysis is just broken here.
_tcf_block_put
first tries to obtain the lock withrefcount_dec_and_mutex_lock
, which is annotated with__try_acquires_mutex(true, lock)
, and then unlocks this mutex later on, or it does not get the lock and does nothing further with the lock.This might need a small example to see if clang thread safety analysis is just broken here.