Coccinelle: Add locks/mini_lock.cocci
authorNicolas Palix <npalix@diku.dk>
Tue, 24 Aug 2010 15:39:00 +0000 (17:39 +0200)
committerMichal Marek <mmarek@suse.cz>
Tue, 31 Aug 2010 09:37:53 +0000 (11:37 +0200)
commit54c056280e0dfcd39b33c4ed75116ce98697511c
treed8c16d5288045ffaf8f46a9fd03d5f1659f8feeb
parent8aa6273106756c30e5349b58eed28d93d8d88164
Coccinelle: Add locks/mini_lock.cocci

Find missing unlocks.  This semantic match considers the specific case
where the unlock is missing from an if branch, and there is a lock
before the if and an unlock after the if.  False positives are due to
cases where the if branch represents a case where the function is
supposed to exit with the lock held, or where there is some preceding
function call that releases the lock.

Signed-off-by: Nicolas Palix <npalix@diku.dk>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/coccinelle/locks/mini_lock.cocci [new file with mode: 0644]