Skip to content

Commit

Permalink
ipv4: remove nested rcu_read_lock/unlock
Browse files Browse the repository at this point in the history
ip_local_deliver_finish() already have a rcu_read_lock/unlock, so
the rcu_read_lock/unlock is unnecessary.

See the stack below:
ip_local_deliver_finish
	|
	|
	->icmp_rcv
		|
		|
		->icmp_socket_deliver

Suggested-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Duan Jiong authored and David S. Miller committed Aug 2, 2014
1 parent e339756 commit 188b121
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,9 @@ static void icmp_socket_deliver(struct sk_buff *skb, u32 info)

raw_icmp_error(skb, protocol, info);

rcu_read_lock();
ipprot = rcu_dereference(inet_protos[protocol]);
if (ipprot && ipprot->err_handler)
ipprot->err_handler(skb, info);
rcu_read_unlock();
}

static bool icmp_tag_validation(int proto)
Expand Down

0 comments on commit 188b121

Please sign in to comment.