aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2012-09-24 14:12:25 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-27 18:12:37 -0400
commitb0558ef24a792906914fcad277f3befe2420e618 (patch)
tree65cacc7cfe54fd50aef515fdbfa52f2aaf532efb /net/ipv4/ipip.c
parent0c5794a66c7c6443759e6098841767958a031187 (diff)
xfrm: remove extranous rcu_read_lock
The handlers for xfrm_tunnel are always invoked with rcu read lock already. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 99af1f0cc658..618bde867ac1 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -365,8 +365,6 @@ static int ipip_err(struct sk_buff *skb, u32 info)
365 } 365 }
366 366
367 err = -ENOENT; 367 err = -ENOENT;
368
369 rcu_read_lock();
370 t = ipip_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr); 368 t = ipip_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr);
371 if (t == NULL) 369 if (t == NULL)
372 goto out; 370 goto out;
@@ -398,7 +396,7 @@ static int ipip_err(struct sk_buff *skb, u32 info)
398 t->err_count = 1; 396 t->err_count = 1;
399 t->err_time = jiffies; 397 t->err_time = jiffies;
400out: 398out:
401 rcu_read_unlock(); 399
402 return err; 400 return err;
403} 401}
404 402
@@ -416,13 +414,11 @@ static int ipip_rcv(struct sk_buff *skb)
416 struct ip_tunnel *tunnel; 414 struct ip_tunnel *tunnel;
417 const struct iphdr *iph = ip_hdr(skb); 415 const struct iphdr *iph = ip_hdr(skb);
418 416
419 rcu_read_lock();
420 tunnel = ipip_tunnel_lookup(dev_net(skb->dev), iph->saddr, iph->daddr); 417 tunnel = ipip_tunnel_lookup(dev_net(skb->dev), iph->saddr, iph->daddr);
421 if (tunnel != NULL) { 418 if (tunnel != NULL) {
422 struct pcpu_tstats *tstats; 419 struct pcpu_tstats *tstats;
423 420
424 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { 421 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
425 rcu_read_unlock();
426 kfree_skb(skb); 422 kfree_skb(skb);
427 return 0; 423 return 0;
428 } 424 }
@@ -445,11 +441,8 @@ static int ipip_rcv(struct sk_buff *skb)
445 ipip_ecn_decapsulate(iph, skb); 441 ipip_ecn_decapsulate(iph, skb);
446 442
447 netif_rx(skb); 443 netif_rx(skb);
448
449 rcu_read_unlock();
450 return 0; 444 return 0;
451 } 445 }
452 rcu_read_unlock();
453 446
454 return -1; 447 return -1;
455} 448}