tcp: md5: remove unneeded check in tcp_v4_parse_md5_keys
authorDmitry Popov <ixaphire@qrator.net>
Sun, 3 Aug 2014 18:45:19 +0000 (22:45 +0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Aug 2014 22:09:45 +0000 (15:09 -0700)
tcpm_key is an array inside struct tcp_md5sig, there is no need to check it
against NULL.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c

index d0ba39537d5cd9c5987046c6ff847b83145413a5..992a1f9260095026515802c9360ce44617d4f591 100644 (file)
@@ -1049,7 +1049,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
        if (sin->sin_family != AF_INET)
                return -EINVAL;
 
-       if (!cmd.tcpm_key || !cmd.tcpm_keylen)
+       if (!cmd.tcpm_keylen)
                return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin->sin_addr.s_addr,
                                      AF_INET);