Rewrite completely with new goal.
[smatch.git] / validation / sm_locking.c
blobac53ec25826c14f9ba07567cfbb160ed23c6c981
1 _spin_lock(int name);
2 _spin_unlock(int name);
4 int a;
5 int b;
6 int func (void)
8 int mylock = 1;
9 int mylock2 = 1;
10 int mylock3 = 1;
12 if (a) {
13 return;
16 _spin_lock(mylock);
17 _spin_unlock(mylock);
19 if (b) {
20 _spin_unlock(mylock2);
21 return;
24 if (a)
25 _spin_lock(mylock3);
26 return;
29 * check-name: Locking inconsistencies
30 * check-command: smatch sm_locking.c
32 * check-output-start
33 sm_locking.c +26 func(20) Unclear if 'mylock3' is locked or unlocked.
34 sm_locking.c +26 func(20) Lock 'mylock2' held on line 26 but not on 21.
35 * check-output-end