sync/lockdep: use RangeRepeatable instead of Range

It is lockless and so it guarantes to avoid nested locks (deadlocks).

Reported-by: syzbot+7f2b94fef2e1109bcd40@syzkaller.appspotmail.com
This commit is contained in:
Andrei Vagin
2022-06-09 12:00:42 -07:00
parent 06f7b645e6
commit 8b41af9330
+1 -1
View File
@@ -70,7 +70,7 @@ func checkLock(class *MutexClass, prevClass *MutexClass, chain []*MutexClass) {
}
panic(b.String())
}
prevClass.ancestors.Range(func(parentClass *MutexClass, stacks *string) bool {
prevClass.ancestors.RangeRepeatable(func(parentClass *MutexClass, stacks *string) bool {
// The recursion is fine here. If it fails, you need to reduce
// a number of nested locks.
checkLock(class, parentClass, chain)