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