diff options
author | Tim Hansen <devtimhansen@gmail.com> | 2017-11-16 12:03:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-18 10:32:41 +0900 |
commit | 17e48577752a61197a7e5f4922db45b3a5af5068 (patch) | |
tree | 8b9fddba42a8efb82ed8cf2f7e9d62e8717591b6 /net/netlabel | |
parent | 58fedcade126c16cf466a0dd1bc59312e1a6b6f1 (diff) | |
download | linux-stable-17e48577752a61197a7e5f4922db45b3a5af5068.tar.gz linux-stable-17e48577752a61197a7e5f4922db45b3a5af5068.tar.bz2 linux-stable-17e48577752a61197a7e5f4922db45b3a5af5068.zip |
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: Tim Hansen <devtimhansen@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlabel')
-rw-r--r-- | net/netlabel/netlabel_addrlist.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h index d0f38bc9af6d..ac709f0f197b 100644 --- a/net/netlabel/netlabel_addrlist.h +++ b/net/netlabel/netlabel_addrlist.h @@ -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; @@ -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; |