File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,12 +15,20 @@ virtual context
1515virtual org
1616virtual report
1717
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+
1825@depends on patch@
1926expression from,to,size;
2027identifier l1,l2;
28+ position p : script:python() { relevant(p) };
2129@@
2230
23- - to = \(kmalloc\|kzalloc\)
31+ - to = \(kmalloc@p \|kzalloc@p \)
2432- (size,\(GFP_KERNEL\|GFP_USER\|
2533- \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
2634+ to = memdup_user(from,size);
@@ -42,9 +50,10 @@ identifier l1,l2;
4250@depends on patch@
4351expression from,to,size;
4452identifier l1,l2;
53+ position p : script:python() { relevant(p) };
4554@@
4655
47- - to = \(kvmalloc\|kvzalloc\)(size,\(GFP_KERNEL\|GFP_USER\));
56+ - to = \(kvmalloc@p \|kvzalloc@p \)(size,\(GFP_KERNEL\|GFP_USER\));
4857+ to = vmemdup_user(from,size);
4958 if (
5059- to==NULL
@@ -63,7 +72,7 @@ identifier l1,l2;
6372
6473@r depends on !patch@
6574expression from,to,size;
66- position p;
75+ position p : script:python() { relevant(p) } ;
6776statement S1,S2;
6877@@
6978
@@ -76,7 +85,7 @@ statement S1,S2;
7685
7786@rv depends on !patch@
7887expression from,to,size;
79- position p;
88+ position p : script:python() { relevant(p) } ;
8089statement S1,S2;
8190@@
8291
You can’t perform that action at this time.
0 commit comments