ClangBuiltLinux / thread-safety-analysis

A research project into applying Clang's Thread Safety Analysis to the Linux Kernel
Other
6 stars 0 forks source link

mm/slub.c: conditional locking and unlocking in deactivate_slab #77

Open himanshujha199640 opened 5 years ago

himanshujha199640 commented 5 years ago

https://elixir.bootlin.com/linux/v5.2-rc2/source/mm/slub.c#L2136

/home/himanshu/clang-thread-safety-analysis/mm/slub.c:2143:6: warning: mutex 'n->list_lock' is not held on every path through here [-Wthread-safety-analysis]
        if (l != m) {
            ^
/home/himanshu/clang-thread-safety-analysis/mm/slub.c:2139:4: note: mutex acquired here
                        spin_lock(&n->list_lock);
                        ^
/home/himanshu/clang-thread-safety-analysis/mm/slub.c:2143:6: warning: mutex 'n->list_lock' is not held on every path through here [-Wthread-safety-analysis]
        if (l != m) {
            ^
/home/himanshu/clang-thread-safety-analysis/mm/slub.c:2128:4: note: mutex acquired here
                        spin_lock(&n->list_lock);
                        ^
/home/himanshu/clang-thread-safety-analysis/mm/slub.c:2163:3: warning: releasing mutex 'n->list_lock' that was not held [-Wthread-safety-analysis]
                spin_unlock(&n->list_lock);
                ^