diff options
author | stephen hemminger <shemminger@vyatta.com> | 2012-09-24 14:12:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-09-27 18:12:37 -0400 |
commit | b0558ef24a792906914fcad277f3befe2420e618 (patch) | |
tree | 65cacc7cfe54fd50aef515fdbfa52f2aaf532efb /net/ipv4 | |
parent | 0c5794a66c7c6443759e6098841767958a031187 (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')
-rw-r--r-- | net/ipv4/ip_vti.c | 5 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 9 |
2 files changed, 1 insertions, 13 deletions
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index 3511ffba7bd4..978bca4818ae 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c | |||
@@ -304,7 +304,6 @@ static int vti_err(struct sk_buff *skb, u32 info) | |||
304 | 304 | ||
305 | err = -ENOENT; | 305 | err = -ENOENT; |
306 | 306 | ||
307 | rcu_read_lock(); | ||
308 | t = vti_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr); | 307 | t = vti_tunnel_lookup(dev_net(skb->dev), iph->daddr, iph->saddr); |
309 | if (t == NULL) | 308 | if (t == NULL) |
310 | goto out; | 309 | goto out; |
@@ -326,7 +325,6 @@ static int vti_err(struct sk_buff *skb, u32 info) | |||
326 | t->err_count = 1; | 325 | t->err_count = 1; |
327 | t->err_time = jiffies; | 326 | t->err_time = jiffies; |
328 | out: | 327 | out: |
329 | rcu_read_unlock(); | ||
330 | return err; | 328 | return err; |
331 | } | 329 | } |
332 | 330 | ||
@@ -336,7 +334,6 @@ static int vti_rcv(struct sk_buff *skb) | |||
336 | struct ip_tunnel *tunnel; | 334 | struct ip_tunnel *tunnel; |
337 | const struct iphdr *iph = ip_hdr(skb); | 335 | const struct iphdr *iph = ip_hdr(skb); |
338 | 336 | ||
339 | rcu_read_lock(); | ||
340 | tunnel = vti_tunnel_lookup(dev_net(skb->dev), iph->saddr, iph->daddr); | 337 | tunnel = vti_tunnel_lookup(dev_net(skb->dev), iph->saddr, iph->daddr); |
341 | if (tunnel != NULL) { | 338 | if (tunnel != NULL) { |
342 | struct pcpu_tstats *tstats; | 339 | struct pcpu_tstats *tstats; |
@@ -348,10 +345,8 @@ static int vti_rcv(struct sk_buff *skb) | |||
348 | u64_stats_update_end(&tstats->syncp); | 345 | u64_stats_update_end(&tstats->syncp); |
349 | 346 | ||
350 | skb->dev = tunnel->dev; | 347 | skb->dev = tunnel->dev; |
351 | rcu_read_unlock(); | ||
352 | return 1; | 348 | return 1; |
353 | } | 349 | } |
354 | rcu_read_unlock(); | ||
355 | 350 | ||
356 | return -1; | 351 | return -1; |
357 | } | 352 | } |
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; |
400 | out: | 398 | out: |
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 | } |