1 /// Make sure calls to d_find_alias() have a corresponding call to dput().
3 // Keywords: d_find_alias, dput
5 // Confidence: Moderate
6 // URL: http://coccinelle.lip6.fr/
7 // Options: --include-headers
15 local idexpression struct dentry *dent;
21 if (!(dent@p1 = d_find_alias(...))) S1
23 dent@p1 = d_find_alias(...)
26 <...when != dput(dent)
27 when != if (...) { <+... dput(dent) ...+> }
28 when != true !dent || ...
34 return <+...dent...+>;
44 local idexpression struct dentry *r.dent;
56 @script:python depends on org@
60 cocci.print_main("Missing call to dput()",p1)
61 cocci.print_secs("",p2)
64 local idexpression struct dentry *r.dent;
75 @script:python depends on report@
79 msg = "Missing call to dput() at line %s."
80 coccilib.report.print_report(p1[0], msg % (p2[0].line))