File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,20 @@ virtual context
15
15
virtual org
16
16
virtual report
17
17
18
+ @initialize:python@
19
+ @@
20
+ filter = frozenset ([' memdup_user' , ' vmemdup_user' ])
21
+
22
+ def relevant (p ):
23
+ return not (filter & {el.current_element for el in p})
24
+
18
25
@depends on patch@
19
26
expression from,to,size;
20
27
identifier l1,l2;
28
+ position p : script:python() { relevant(p) };
21
29
@@
22
30
23
- - to = \(kmalloc\|kzalloc\)
31
+ - to = \(kmalloc@p \|kzalloc@p \)
24
32
- (size,\(GFP_KERNEL\|GFP_USER\|
25
33
- \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
26
34
+ to = memdup_user(from,size);
@@ -42,9 +50,10 @@ identifier l1,l2;
42
50
@depends on patch@
43
51
expression from,to,size;
44
52
identifier l1,l2;
53
+ position p : script:python() { relevant(p) };
45
54
@@
46
55
47
- - to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\));
56
+ - to = \(kvmalloc@p \|kvzalloc@p \)(size,\(GFP_KERNEL\|GFP_USER\));
48
57
+ to = vmemdup_user(from,size);
49
58
if (
50
59
- to==NULL
@@ -63,7 +72,7 @@ identifier l1,l2;
63
72
64
73
@r depends on !patch@
65
74
expression from,to,size;
66
- position p;
75
+ position p : script:python() { relevant(p) } ;
67
76
statement S1,S2;
68
77
@@
69
78
@@ -76,7 +85,7 @@ statement S1,S2;
76
85
77
86
@rv depends on !patch@
78
87
expression from,to,size;
79
- position p;
88
+ position p : script:python() { relevant(p) } ;
80
89
statement S1,S2;
81
90
@@
82
91
You can’t perform that action at this time.
0 commit comments