Commit 6d086587 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

ip6mr: do not acquire mrt_lock in pim6_rcv()



rcu_read_lock() protection is more than enough.

vif_dev_read() supports either mrt_lock or rcu_read_lock().

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3493a5b7
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -559,12 +559,11 @@ static int pim6_rcv(struct sk_buff *skb)

	if (ip6mr_fib_lookup(net, &fl6, &mrt) < 0)
		goto drop;
	reg_vif_num = mrt->mroute_reg_vif_num;

	read_lock(&mrt_lock);
	/* Pairs with WRITE_ONCE() in mif6_add()/mif6_delete() */
	reg_vif_num = READ_ONCE(mrt->mroute_reg_vif_num);
	if (reg_vif_num >= 0)
		reg_dev = vif_dev_read(&mrt->vif_table[reg_vif_num]);
	read_unlock(&mrt_lock);

	if (!reg_dev)
		goto drop;