]> git.baikalelectronics.ru Git - kernel.git/commitdiff
gtp: remove useless rcu_read_lock()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 28 Aug 2020 13:30:55 +0000 (15:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2020 19:24:34 +0000 (12:24 -0700)
The rtnl lock is taken just the line above, no need to take the rcu also.

Fixes: fcdced5d8fbb ("gtp: fix use-after-free in gtp_encap_destroy()")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gtp.c

index c84a105693886dbdb7d6d465789ca2bcc45fe561..6f871ec31393462af560e5c391df6443d7bca067 100644 (file)
@@ -1071,7 +1071,6 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
        }
 
        rtnl_lock();
-       rcu_read_lock();
 
        gtp = gtp_find_dev(sock_net(skb->sk), info->attrs);
        if (!gtp) {
@@ -1100,7 +1099,6 @@ static int gtp_genl_new_pdp(struct sk_buff *skb, struct genl_info *info)
        }
 
 out_unlock:
-       rcu_read_unlock();
        rtnl_unlock();
        return err;
 }