Skip to content

Commit

Permalink
ip6mr: do not get a device reference in pim6_rcv()
Browse files Browse the repository at this point in the history
pim6_rcv() is called under rcu_read_lock(), there is
no need to use dev_hold()/dev_put() pair.

IPv4 side was handled in commit 55747a0
("ipmr: __pim_rcv() is called under rcu_read_lock")

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 24, 2022
1 parent 7fcb820 commit 0a24c43
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/ipv6/ip6mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ static int pim6_rcv(struct sk_buff *skb)
read_lock(&mrt_lock);
if (reg_vif_num >= 0)
reg_dev = mrt->vif_table[reg_vif_num].dev;
dev_hold(reg_dev);
read_unlock(&mrt_lock);

if (!reg_dev)
Expand All @@ -570,7 +569,6 @@ static int pim6_rcv(struct sk_buff *skb)

netif_rx(skb);

dev_put(reg_dev);
return 0;
drop:
kfree_skb(skb);
Expand Down

0 comments on commit 0a24c43

Please sign in to comment.