aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2017-04-11 20:46:38 +0200
committerMister Oyster <oysterized@gmail.com>2017-04-25 11:28:19 +0200
commit12f097688a4d91cdd36fced51d7c944d813a1404 (patch)
tree8451fabab635ea8f2faf826971dfe81cff2c4ce2 /net/ipv4
parent36ce3fbda96fdc07b67e7ef97d875f96ae68b655 (diff)
net: Fix maybe-uninitialized variables
Change-Id: I83202d1362a1d01fbd5be6c23f2f47fe60efcb61
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_metrics.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c
index 378b1886d..5f3c077a5 100644
--- a/net/ipv4/tcp_metrics.c
+++ b/net/ipv4/tcp_metrics.c
@@ -229,6 +229,8 @@ static struct tcp_metrics_block *__tcp_get_metrics_req(struct request_sock *req,
unsigned int hash;
struct net *net;
+ memset(&addr, 0, sizeof(addr));
+
addr.family = req->rsk_ops->family;
switch (addr.family) {
case AF_INET:
@@ -263,6 +265,8 @@ static struct tcp_metrics_block *__tcp_get_metrics_tw(struct inet_timewait_sock
unsigned int hash;
struct net *net;
+ memset(&addr, 0, sizeof(addr));
+
addr.family = tw->tw_family;
switch (addr.family) {
case AF_INET:
@@ -298,6 +302,8 @@ static struct tcp_metrics_block *tcp_get_metrics(struct sock *sk,
unsigned int hash;
struct net *net;
+ memset(&addr, 0, sizeof(addr));
+
addr.family = sk->sk_family;
switch (addr.family) {
case AF_INET:
@@ -903,6 +909,8 @@ static int tcp_metrics_nl_cmd_get(struct sk_buff *skb, struct genl_info *info)
void *reply;
int ret;
+ memset(&addr, 0, sizeof(addr));
+
ret = parse_nl_addr(info, &addr, &hash, 0);
if (ret < 0)
return ret;
@@ -981,6 +989,8 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info)
struct net *net = genl_info_net(info);
int ret;
+ memset(&addr, 0, sizeof(addr));
+
ret = parse_nl_addr(info, &addr, &hash, 1);
if (ret < 0)
return ret;