db: don't print "failed to open" warnings...
[smatch.git] / validation / sm_locking3.c
blobc63ec5cab21af36a793d9537371b61f88735e663
1 int _spin_trylock(int name);
2 void _spin_lock(int name);
3 void _spin_unlock(int name);
5 int func (void)
7 int mylock = 1;
9 if (!({frob(); frob(); _spin_trylock(mylock);}))
10 return;
12 frob();
13 _spin_unlock(mylock);
15 if (((_spin_trylock(mylock)?1:0)?1:0))
16 return;
17 frob_somemore();
18 _spin_unlock(mylock);
20 return;
23 * check-name: Smatch locking #3
24 * check-command: smatch --project=kernel sm_locking3.c
26 * check-output-start
27 sm_locking3.c:18 func() error: double unlock 'spin_lock:mylock'
28 sm_locking3.c:20 func() warn: inconsistent returns 'spin_lock:mylock'.
29 Locked on: line 16
30 Unlocked on: line 10
31 line 20
32 * check-output-end