| /// PTR_ERR should access the value just tested by IS_ERR |
| //# There can be false positives in the patch case, where it is the call |
| //# IS_ERR that is wrong. |
| // Copyright: (C) 2012 Julia Lawall, INRIA. GPLv2. |
| // Copyright: (C) 2012 Gilles Muller, INRIA. GPLv2. |
| // URL: http://coccinelle.lip6.fr/ |
| // Options: --no-includes --include-headers |
| if (IS_ERR(e)) { ... PTR_ERR(e) ... } |
| if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... } |
| if (IS_ERR(e)) { ... PTR_ERR(e) ... } |
| if (IS_ERR(e=e1)) { ... PTR_ERR(e) ... } |
| @script:python depends on org@ |
| cocci.print_main("inconsistent IS_ERR and PTR_ERR",p1) |
| cocci.print_secs("PTR_ERR",p2) |
| @script:python depends on report@ |
| msg = "inconsistent IS_ERR and PTR_ERR, PTR_ERR on line %s" % (p2[0].line) |
| coccilib.report.print_report(p1[0],msg) |