ipv4: remove nested rcu_read_lock/unlock
authorDuan Jiong <duanj.fnst@cn.fujitsu.com>
Fri, 1 Aug 2014 06:00:36 +0000 (14:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 2 Aug 2014 22:27:35 +0000 (15:27 -0700)
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>
net/ipv4/icmp.c

index 092400ef88d08f85e6c3a2bfe4ff1ce7f15557c5..ea7d4afe8205860ca4917f5403821c7afa4aa227 100644 (file)
@@ -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)