diff options
author | Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> | 2015-03-20 09:26:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-20 13:31:24 -0400 |
commit | 149d7549c22045bc777a377720809b108639f9e9 (patch) | |
tree | c9949bfad84037991bb365466a2782802aa9abb6 /drivers/net/vxlan.c | |
parent | edafc132baac4f5331b7bffd99a7af371776f2b5 (diff) |
vxlan: fix possible use of uninitialized in vxlan_igmp_{join, leave}
Test robot noticed that we check the return of vxlan_igmp_join and leave
but inside them there was a path that it could be used initialized.
It's not really possible because those if() inside these igmp functions
would always match as we can't have sockets of other type in there, but
this way we keep the compiler happy.
Fixes: 56ef9c909b40 ("vxlan: Move socket initialization to within rtnl scope")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 5f749a51f356..e75e4b2e6031 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1093,7 +1093,7 @@ static int vxlan_igmp_join(struct vxlan_dev *vxlan) | |||
1093 | struct sock *sk = vs->sock->sk; | 1093 | struct sock *sk = vs->sock->sk; |
1094 | union vxlan_addr *ip = &vxlan->default_dst.remote_ip; | 1094 | union vxlan_addr *ip = &vxlan->default_dst.remote_ip; |
1095 | int ifindex = vxlan->default_dst.remote_ifindex; | 1095 | int ifindex = vxlan->default_dst.remote_ifindex; |
1096 | int ret; | 1096 | int ret = -EINVAL; |
1097 | 1097 | ||
1098 | lock_sock(sk); | 1098 | lock_sock(sk); |
1099 | if (ip->sa.sa_family == AF_INET) { | 1099 | if (ip->sa.sa_family == AF_INET) { |
@@ -1121,7 +1121,7 @@ static int vxlan_igmp_leave(struct vxlan_dev *vxlan) | |||
1121 | struct sock *sk = vs->sock->sk; | 1121 | struct sock *sk = vs->sock->sk; |
1122 | union vxlan_addr *ip = &vxlan->default_dst.remote_ip; | 1122 | union vxlan_addr *ip = &vxlan->default_dst.remote_ip; |
1123 | int ifindex = vxlan->default_dst.remote_ifindex; | 1123 | int ifindex = vxlan->default_dst.remote_ifindex; |
1124 | int ret; | 1124 | int ret = -EINVAL; |
1125 | 1125 | ||
1126 | lock_sock(sk); | 1126 | lock_sock(sk); |
1127 | if (ip->sa.sa_family == AF_INET) { | 1127 | if (ip->sa.sa_family == AF_INET) { |