tcp: Silence warning: ‘in6’ may be used uninitialized
authorJon Medhurst <tixy@linaro.org>
Thu, 16 Apr 2015 12:46:53 +0000 (18:16 +0530)
committerAmit Pundir <amit.pundir@linaro.org>
Thu, 16 Apr 2015 12:46:53 +0000 (18:16 +0530)
Initialise in6 to avoid...

In file included from include/net/inetpeer.h:15:0,
                 from include/net/route.h:28,
                 from include/net/inet_hashtables.h:32,
                 from include/net/tcp.h:37,
                 from net/ipv4/tcp.c:275:
net/ipv4/tcp.c: In function ‘tcp_nuke_addr’:
include/net/ipv6.h:417:34: warning: ‘in6’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL;
                                  ^
net/ipv4/tcp.c:3513:19: note: ‘in6’ was declared here
  struct in6_addr *in6;

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
net/ipv4/tcp.c

index 089a948fe83441586259d39fa7939d5ee3416f0d..a2639cb7c9d819e9a7d5dda79800a14a03aa1290 100644 (file)
@@ -3490,7 +3490,7 @@ int tcp_nuke_addr(struct net *net, struct sockaddr *addr)
 
        struct in_addr *in;
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-       struct in6_addr *in6;
+       struct in6_addr *in6 = NULL;
 #endif
        if (family == AF_INET) {
                in = &((struct sockaddr_in *)addr)->sin_addr;