diff options
Diffstat (limited to 'scripts/coccinelle/free/kfree.cocci')
-rw-r--r-- | scripts/coccinelle/free/kfree.cocci | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/coccinelle/free/kfree.cocci b/scripts/coccinelle/free/kfree.cocci index f9f79d9245ee..d9ae6d89c2f5 100644 --- a/scripts/coccinelle/free/kfree.cocci +++ b/scripts/coccinelle/free/kfree.cocci | |||
@@ -5,9 +5,9 @@ | |||
5 | //# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument | 5 | //# SCTP_DBG_OBJCNT_DEC that do not actually evaluate their argument |
6 | /// | 6 | /// |
7 | // Confidence: Moderate | 7 | // Confidence: Moderate |
8 | // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. | 8 | // Copyright: (C) 2010-2012 Nicolas Palix. GPLv2. |
9 | // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. | 9 | // Copyright: (C) 2010-2012 Julia Lawall, INRIA/LIP6. GPLv2. |
10 | // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. | 10 | // Copyright: (C) 2010-2012 Gilles Muller, INRIA/LiP6. GPLv2. |
11 | // URL: http://coccinelle.lip6.fr/ | 11 | // URL: http://coccinelle.lip6.fr/ |
12 | // Comments: | 12 | // Comments: |
13 | // Options: -no_includes -include_headers | 13 | // Options: -no_includes -include_headers |
@@ -23,7 +23,7 @@ position p1; | |||
23 | kfree@p1(E) | 23 | kfree@p1(E) |
24 | 24 | ||
25 | @print expression@ | 25 | @print expression@ |
26 | constant char *c; | 26 | constant char [] c; |
27 | expression free.E,E2; | 27 | expression free.E,E2; |
28 | type T; | 28 | type T; |
29 | position p; | 29 | position p; |
@@ -37,6 +37,10 @@ identifier f; | |||
37 | | | 37 | | |
38 | E@p != E2 | 38 | E@p != E2 |
39 | | | 39 | | |
40 | E2 == E@p | ||
41 | | | ||
42 | E2 != E@p | ||
43 | | | ||
40 | !E@p | 44 | !E@p |
41 | | | 45 | | |
42 | E@p || ... | 46 | E@p || ... |
@@ -113,5 +117,5 @@ p1 << free.p1; | |||
113 | p2 << r.p2; | 117 | p2 << r.p2; |
114 | @@ | 118 | @@ |
115 | 119 | ||
116 | msg = "reference preceded by free on line %s" % (p1[0].line) | 120 | msg = "ERROR: reference preceded by free on line %s" % (p1[0].line) |
117 | coccilib.report.print_report(p2[0],msg) | 121 | coccilib.report.print_report(p2[0],msg) |