| /// Make sure calls to d_find_alias() have a corresponding call to dput(). |
| // Keywords: d_find_alias, dput |
| // URL: http://coccinelle.lip6.fr/ |
| // Options: --include-headers |
| local idexpression struct dentry *dent; |
| if (!(dent@p1 = d_find_alias(...))) S1 |
| dent@p1 = d_find_alias(...) |
| when != if (...) { <+... dput(dent) ...+> } |
| when != true !dent || ... |
| local idexpression struct dentry *r.dent; |
| @script:python depends on org@ |
| cocci.print_main("Missing call to dput()",p1) |
| local idexpression struct dentry *r.dent; |
| @script:python depends on report@ |
| msg = "Missing call to dput() at line %s." |
| coccilib.report.print_report(p1[0], msg % (p2[0].line)) |