l2tp: remove useless NULL check in __l2tp_ip*_bind_lookup()
authorGuillaume Nault <g.nault@alphalink.fr>
Fri, 6 Jan 2017 19:03:56 +0000 (20:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Jan 2017 03:18:56 +0000 (22:18 -0500)
If "l2tp" was NULL, that'd mean "sk" is NULL too. This can't happen
since "sk" is returned by sk_for_each_bound().

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_ip.c
net/l2tp/l2tp_ip6.c

index e5686bf898f7c19476c2ceb673f71add95e8ef3d..499d3cdbfbc803e0aed079af1238534b386ecea9 100644 (file)
@@ -56,9 +56,6 @@ static struct sock *__l2tp_ip_bind_lookup(const struct net *net, __be32 laddr,
                const struct l2tp_ip_sock *l2tp = l2tp_ip_sk(sk);
                const struct inet_sock *inet = inet_sk(sk);
 
-               if (l2tp == NULL)
-                       continue;
-
                if ((l2tp->conn_id == tunnel_id) &&
                    net_eq(sock_net(sk), net) &&
                    !(inet->inet_rcv_saddr && inet->inet_rcv_saddr != laddr) &&
index 2f6be6ddc8cbf63d0f7e514c059b498cbe8453ff..7165b06d7b255fa0f705630342a5f5710666200e 100644 (file)
@@ -69,9 +69,6 @@ static struct sock *__l2tp_ip6_bind_lookup(const struct net *net,
                const struct in6_addr *sk_raddr = &sk->sk_v6_daddr;
                const struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk);
 
-               if (l2tp == NULL)
-                       continue;
-
                if ((l2tp->conn_id == tunnel_id) &&
                    net_eq(sock_net(sk), net) &&
                    (!sk_laddr || ipv6_addr_any(sk_laddr) || ipv6_addr_equal(sk_laddr, laddr)) &&