aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2017-01-26 20:37:25 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:32:06 +0200
commit16e7cfff9e380882f7586583dcdc3f1127ab5e58 (patch)
tree532946e9a04ec34b01ae8b8f49d1c74672c2ac58
parent8024e4be94213b0275c765c9e804eef811ef2dda (diff)
net: ipv4: fix maybe-uninitialized warnings
In file included from include/net/inetpeer.h:15:0, from net/ipv4/tcp_metrics.c:16: net/ipv4/tcp_metrics.c: In function 'tcp_peer_is_proven': include/net/ipv6.h:436:38: warning: '*((void *)&addr+8)' may be used uninitialized in this function [-Wmaybe-uninitialized] return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL; ~~~~~~~~^~~~~~~~~ net/ipv4/tcp_metrics.c:228:23: note: '*((void *)&addr+8)' was declared here struct inetpeer_addr addr; ^~~~ In file included from include/net/inetpeer.h:15:0, from net/ipv4/tcp_metrics.c:16: net/ipv4/tcp_metrics.c: In function 'tcp_tw_remember_stamp': include/net/ipv6.h:436:38: warning: '*((void *)&addr+8)' may be used uninitialized in this function [-Wmaybe-uninitialized] return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL; ~~~~~~~~^~~~~~~~~ net/ipv4/tcp_metrics.c:262:23: note: '*((void *)&addr+8)' was declared here struct inetpeer_addr addr; ^~~~ Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
-rw-r--r--net/ipv4/tcp_metrics.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index b500d2ddc..378b1886d 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -225,7 +225,7 @@ static struct tcp_metrics_block *__tcp_get_metrics_req(struct request_sock *req,
struct dst_entry *dst)
{
struct tcp_metrics_block *tm;
- struct inetpeer_addr addr;
+ struct inetpeer_addr addr = (struct inetpeer_addr){0};
unsigned int hash;
struct net *net;
@@ -259,7 +259,7 @@ static struct tcp_metrics_block *__tcp_get_metrics_tw(struct inet_timewait_sock
{
struct inet6_timewait_sock *tw6;
struct tcp_metrics_block *tm;
- struct inetpeer_addr addr;
+ struct inetpeer_addr addr = (struct inetpeer_addr){0};
unsigned int hash;
struct net *net;