implied_value: don't get confused by casts
[smatch.git] / validation / sm_dev_hold.c
blob0d86ea1d8251e77ff17411addab9e29650092795
1 void dev_hold(int *x);
3 void dev_put(int *x){}
5 extern int y,z;
7 int func (void)
9 int *x;
11 dev_hold(x);
12 if (y) {
13 dev_put(x);
14 return -1;
16 if (z) {
17 return -1;
19 return 0;
22 * check-name: dev_hold() check
23 * check-command: smatch --project=kernel sm_dev_hold.c
25 * check-output-start
26 sm_dev_hold.c:17 func() warn: 'x' held on error path.
27 * check-output-end