Skip to content

Commit

Permalink
ipv6: fix a RCU warning in net/ipv6/ip6_flowlabel.c
Browse files Browse the repository at this point in the history
This patch fixes the following RCU warning:

[   51.680236] ===============================
[   51.681914] [ INFO: suspicious RCU usage. ]
[   51.683610] 3.8.0-rc6-next-20130206-sasha-00028-g83214f7-dirty torvalds#276 Tainted: G        W
[   51.686703] -------------------------------
[   51.688281] net/ipv6/ip6_flowlabel.c:671 suspicious rcu_dereference_check() usage!

we should use rcu_dereference_bh() when we hold rcu_read_lock_bh().

Reported-by: Sasha Levin <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Amerigo Wang authored and davem330 committed Feb 8, 2013
1 parent 14f8dc4 commit 6a98dcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/ipv6/ip6_flowlabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ static DEFINE_SPINLOCK(ip6_fl_lock);
static DEFINE_SPINLOCK(ip6_sk_fl_lock);

#define for_each_fl_rcu(hash, fl) \
for (fl = rcu_dereference(fl_ht[(hash)]); \
for (fl = rcu_dereference_bh(fl_ht[(hash)]); \
fl != NULL; \
fl = rcu_dereference(fl->next))
fl = rcu_dereference_bh(fl->next))
#define for_each_fl_continue_rcu(fl) \
for (fl = rcu_dereference(fl->next); \
for (fl = rcu_dereference_bh(fl->next); \
fl != NULL; \
fl = rcu_dereference(fl->next))
fl = rcu_dereference_bh(fl->next))

#define for_each_sk_fl_rcu(np, sfl) \
for (sfl = rcu_dereference_bh(np->ipv6_fl_list); \
Expand Down

0 comments on commit 6a98dcf

Please sign in to comment.