[RFC PATCH 02/13] scripts: coccinelle: adapt to find list_for_each_entry nospec issues

From: Jakob Koschel
Date: Thu Feb 17 2022 - 13:50:07 EST


These changes are just temporary to illustrate how I composed the list
of code locations mentioned here.
While for example the usage of &c->member is currently safe to use,
it is an issue if c is set to NULL when the terminating condition is
met.

Signed-off-by: Jakob Koschel <jakobkoschel@xxxxxxxxx>
---
.../coccinelle/iterators/use_after_iter.cocci | 24 -------------------
1 file changed, 24 deletions(-)

diff --git a/scripts/coccinelle/iterators/use_after_iter.cocci b/scripts/coccinelle/iterators/use_after_iter.cocci
index 676edd562eef..01563a242f00 100644
--- a/scripts/coccinelle/iterators/use_after_iter.cocci
+++ b/scripts/coccinelle/iterators/use_after_iter.cocci
@@ -91,43 +91,19 @@ list_for_each_entry(c,...) S
|
list_for_each_entry_reverse(c,...) S
|
-list_for_each_entry_continue(c,...) S
-|
-list_for_each_entry_continue_reverse(c,...) S
-|
-list_for_each_entry_from(c,...) S
-|
list_for_each_entry_safe(c,...) S
|
list_for_each_entry_safe(x,c,...) S
|
-list_for_each_entry_safe_continue(c,...) S
-|
-list_for_each_entry_safe_continue(x,c,...) S
-|
-list_for_each_entry_safe_from(c,...) S
-|
-list_for_each_entry_safe_from(x,c,...) S
-|
list_for_each_entry_safe_reverse(c,...) S
|
list_for_each_entry_safe_reverse(x,c,...) S
|
hlist_for_each_entry(c,...) S
|
-hlist_for_each_entry_continue(c,...) S
-|
-hlist_for_each_entry_from(c,...) S
-|
hlist_for_each_entry_safe(c,...) S
|
-list_remove_head(x,c,...)
-|
-list_entry_is_head(c,...)
-|
sizeof(<+...c...+>)
-|
- &c->member
|
T c;
|
--
2.25.1