ranges: simplify and robustify str_to_rl_helper() a bit
[smatch.git] / validation / sm_check_kunmap.c
bloba094c1684ea5fb420a25421ec7cd4d3b8ba2ec96
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 void func(void)
10 int page;
11 int x;
12 int y;
13 int z;
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