1 #include "check_debug.h"
2
3 int copy_from_user(void *dest, void *src, int size){}
4
5 struct my_struct {
6 int x, y;
7 };
8
9 void *pointer;
10 struct my_struct *dest;
11
12 struct my_struct *returns_copy(void)
13 {
14 copy_from_user(dest, pointer, sizeof(*dest));
15 return dest;
16 }
17
18 struct my_struct *a;
19 void test(void)
20 {
21 a = returns_copy();
22 __smatch_user_rl(a->x);
23 }
24
25 /*
26 * check-name: smatch user data #2
27 * check-command: smatch -p=kernel -I.. sm_user_data2.c
28 *
29 * check-output-start
30 sm_user_data2.c:22 test() user rl: 'a->x' = 's32min-s32max'
31 * check-output-end
32 */