Skip to content

Commit

Permalink
net/netlabel: Add list_next_rcu() in rcu_dereference().
Browse files Browse the repository at this point in the history
Add list_next_rcu() for fetching next list in rcu_deference safely.

Found with sparse in linux-next tree on tag next-20171116.

Signed-off-by: Tim Hansen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Tim Hansen authored and davem330 committed Nov 18, 2017
1 parent 58fedca commit 17e4857
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/netlabel/netlabel_addrlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static inline struct netlbl_af4list *__af4list_valid_rcu(struct list_head *s,
struct list_head *i = s;
struct netlbl_af4list *n = __af4list_entry(s);
while (i != h && !n->valid) {
i = rcu_dereference(i->next);
i = rcu_dereference(list_next_rcu(i));
n = __af4list_entry(i);
}
return n;
Expand Down Expand Up @@ -154,7 +154,7 @@ static inline struct netlbl_af6list *__af6list_valid_rcu(struct list_head *s,
struct list_head *i = s;
struct netlbl_af6list *n = __af6list_entry(s);
while (i != h && !n->valid) {
i = rcu_dereference(i->next);
i = rcu_dereference(list_next_rcu(i));
n = __af6list_entry(i);
}
return n;
Expand Down

0 comments on commit 17e4857

Please sign in to comment.