All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cocci] [PATCH] coccinelle: api: kfree_sensitive: print memset position
@ 2020-10-09 12:54 ` Denis Efremov
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Efremov @ 2020-10-09 12:54 UTC (permalink / raw)
  To: julia.lawall; +Cc: cocci, linux-kernel

Print memset() call position in addition to the kfree() position to
ease issues identification.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 scripts/coccinelle/api/kfree_sensitive.cocci | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/coccinelle/api/kfree_sensitive.cocci b/scripts/coccinelle/api/kfree_sensitive.cocci
index e4a066a0b77d..8d980ebf3223 100644
--- a/scripts/coccinelle/api/kfree_sensitive.cocci
+++ b/scripts/coccinelle/api/kfree_sensitive.cocci
@@ -85,14 +85,16 @@ type T;
 
 @script:python depends on report@
 p << r.p;
+m << r.m;
 @@
 
-coccilib.report.print_report(p[0],
-  "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.report.print_report(p[0], msg % (m[0].line))
 
 @script:python depends on org@
 p << r.p;
+m << r.m;
 @@
 
-coccilib.org.print_todo(p[0],
-  "WARNING: opportunity for kfree_sensitive/kvfree_sensitive")
+msg = "WARNING opportunity for kfree_sensitive/kvfree_sensitive (memset at line %s)"
+coccilib.org.print_todo(p[0], msg % (m[0].line))
-- 
2.26.2

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-10 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-09 12:54 [Cocci] [PATCH] coccinelle: api: kfree_sensitive: print memset position Denis Efremov
2020-10-09 12:54 ` Denis Efremov
2020-10-10 19:27 ` [Cocci] " Julia Lawall
2020-10-10 19:27   ` Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.