Commit 17e48577 authored by Tim Hansen's avatar Tim Hansen Committed by David S. Miller

net/netlabel: Add list_next_rcu() in rcu_dereference().

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: default avatarTim Hansen <devtimhansen@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58fedcad
...@@ -87,7 +87,7 @@ static inline struct netlbl_af4list *__af4list_valid_rcu(struct list_head *s, ...@@ -87,7 +87,7 @@ static inline struct netlbl_af4list *__af4list_valid_rcu(struct list_head *s,
struct list_head *i = s; struct list_head *i = s;
struct netlbl_af4list *n = __af4list_entry(s); struct netlbl_af4list *n = __af4list_entry(s);
while (i != h && !n->valid) { while (i != h && !n->valid) {
i = rcu_dereference(i->next); i = rcu_dereference(list_next_rcu(i));
n = __af4list_entry(i); n = __af4list_entry(i);
} }
return n; return n;
...@@ -154,7 +154,7 @@ static inline struct netlbl_af6list *__af6list_valid_rcu(struct list_head *s, ...@@ -154,7 +154,7 @@ static inline struct netlbl_af6list *__af6list_valid_rcu(struct list_head *s,
struct list_head *i = s; struct list_head *i = s;
struct netlbl_af6list *n = __af6list_entry(s); struct netlbl_af6list *n = __af6list_entry(s);
while (i != h && !n->valid) { while (i != h && !n->valid) {
i = rcu_dereference(i->next); i = rcu_dereference(list_next_rcu(i));
n = __af6list_entry(i); n = __af6list_entry(i);
} }
return n; return n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment