lkml.org 
[lkml]   [2022]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 02/13] scripts: coccinelle: adapt to find list_for_each_entry nospec issues
Date
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@gmail.com>
---
.../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
\
 
 \ /
  Last update: 2022-02-17 19:50    [W:0.208 / U:0.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site