param_key: use get_name_sym_from_key() instead of return_state_to_var_sym()
[smatch.git] / validation / sm_check_kunmap.c
blob871f30c68971eda496d568955c3fb20583464e2c
1 void something();
3 int kmap(int p);
4 int kunmap(int p);
5 int kmap_atomic(int p);
6 int kunmap_atomic(int p);
8 int page;
9 int x;
10 int y;
11 int z;
13 void func(void)
15 x = kmap(page);
16 kunmap(page);
17 kunmap(x);
18 y = kmap_atomic(z);
19 kunmap_atomic(y);
20 kunmap_atomic(z);
23 * check-name: smatch check kunmap
24 * check-command: smatch -p=kernel sm_check_kunmap.c
26 * check-output-start
27 sm_check_kunmap.c:17 func() warn: passing the wrong variable to kunmap()
28 sm_check_kunmap.c:20 func() warn: passing the wrong variable to kmap_atomic()
29 * check-output-end