param_key: use get_name_sym_from_key() instead of return_state_to_var_sym()
[smatch.git] / validation / sm_locking4.c
blob91b4f5047d293f5cdc9b197111ba82e77b8554a4
1 void _spin_lock(int name);
2 void _spin_unlock(int name);
4 void frob(void){}
5 int a;
6 int b;
7 void func (void)
9 int mylock = 1;
10 int mylock2 = 2;
12 if (1)
13 _spin_unlock(mylock);
14 frob();
15 if (a)
16 return;
17 if (!0)
18 _spin_lock(mylock);
19 if (0)
20 _spin_unlock(mylock);
21 if (b)
22 return;
23 if (!1)
24 _spin_lock(mylock);
27 * check-name: Smatch locking #4
28 * check-command: smatch --project=kernel -DCONFIG_SMP=y sm_locking4.c
30 * check-output-start
31 sm_locking4.c:23 func() warn: inconsistent returns 'mylock'.
32 Locked on : 22-23
33 Unlocked on: 16
34 * check-output-end