]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: Add coccinelle script to catch thread to NULL assignments
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 4 Oct 2021 16:27:27 +0000 (19:27 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Mon, 4 Oct 2021 16:29:06 +0000 (19:29 +0300)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tools/coccinelle/struct_thread_null.cocci [new file with mode: 0644]

diff --git a/tools/coccinelle/struct_thread_null.cocci b/tools/coccinelle/struct_thread_null.cocci
new file mode 100644 (file)
index 0000000..4867b44
--- /dev/null
@@ -0,0 +1,9 @@
+@@
+identifier I;
+identifier func =~ "thread_add_";
+struct thread *thread;
+@@
+
+*thread = NULL;
+...
+func