* [PATCH net-next 1/4] ipmr: __pim_rcv() is called under rcu_read_lock
@ 2010-10-02 2:14 Eric Dumazet
2010-10-04 4:51 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2010-10-02 2:14 UTC (permalink / raw)
To: David Miller; +Cc: netdev
No need to get a reference on reg_dev and release it, we are in a
rcu_read_lock() protected section.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/ipmr.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 10b24c0..1a92ebd 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1805,6 +1805,7 @@ dont_forward:
}
#ifdef CONFIG_IP_PIMSM
+/* called with rcu_read_lock() */
static int __pim_rcv(struct mr_table *mrt, struct sk_buff *skb,
unsigned int pimlen)
{
@@ -1826,26 +1827,23 @@ static int __pim_rcv(struct mr_table *mrt, struct sk_buff *skb,
read_lock(&mrt_lock);
if (mrt->mroute_reg_vif_num >= 0)
reg_dev = mrt->vif_table[mrt->mroute_reg_vif_num].dev;
- if (reg_dev)
- dev_hold(reg_dev);
read_unlock(&mrt_lock);
if (reg_dev == NULL)
return 1;
skb->mac_header = skb->network_header;
- skb_pull(skb, (u8*)encap - skb->data);
+ skb_pull(skb, (u8 *)encap - skb->data);
skb_reset_network_header(skb);
skb->protocol = htons(ETH_P_IP);
- skb->ip_summed = 0;
+ skb->ip_summed = CHECKSUM_NONE;
skb->pkt_type = PACKET_HOST;
skb_tunnel_rx(skb, reg_dev);
netif_rx(skb);
- dev_put(reg_dev);
- return 0;
+ return NET_RX_SUCCESS;
}
#endif
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next 1/4] ipmr: __pim_rcv() is called under rcu_read_lock
2010-10-02 2:14 [PATCH net-next 1/4] ipmr: __pim_rcv() is called under rcu_read_lock Eric Dumazet
@ 2010-10-04 4:51 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-10-04 4:51 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 02 Oct 2010 04:14:55 +0200
> No need to get a reference on reg_dev and release it, we are in a
> rcu_read_lock() protected section.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-04 4:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-02 2:14 [PATCH net-next 1/4] ipmr: __pim_rcv() is called under rcu_read_lock Eric Dumazet
2010-10-04 4:51 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).