diff options
author | Denis Efremov <yefremov.denis@gmail.com> | 2012-08-11 16:26:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-12 16:40:48 -0400 |
commit | 3a7f8c34fefb109903af9a0fac6d0d05f93335c5 (patch) | |
tree | 486426c2c3c3add25526788faf06dd93f99ec12a /drivers/net/macvtap.c | |
parent | 2359a47671fc4fb0fe5e9945f76c2cb10792c0f8 (diff) |
macvtap: rcu_dereference outside read-lock section
rcu_dereference occurs in update section. Replacement by
rcu_dereference_protected in order to prevent lockdep
complaint.
Found by Linux Driver Verification project (linuxtesting.org)
Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r-- | drivers/net/macvtap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 0737bd4d1669..0f0f9ce3a776 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -94,7 +94,8 @@ static int get_slot(struct macvlan_dev *vlan, struct macvtap_queue *q) | |||
94 | int i; | 94 | int i; |
95 | 95 | ||
96 | for (i = 0; i < MAX_MACVTAP_QUEUES; i++) { | 96 | for (i = 0; i < MAX_MACVTAP_QUEUES; i++) { |
97 | if (rcu_dereference(vlan->taps[i]) == q) | 97 | if (rcu_dereference_protected(vlan->taps[i], |
98 | lockdep_is_held(&macvtap_lock)) == q) | ||
98 | return i; | 99 | return i; |
99 | } | 100 | } |
100 | 101 | ||