提交 149d7549 编写于 作者: M Marcelo Ricardo Leitner 提交者: David S. Miller

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: 56ef9c90 ("vxlan: Move socket initialization to within rtnl scope")
Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: NMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 edafc132
......@@ -1093,7 +1093,7 @@ static int vxlan_igmp_join(struct vxlan_dev *vxlan)
struct sock *sk = vs->sock->sk;
union vxlan_addr *ip = &vxlan->default_dst.remote_ip;
int ifindex = vxlan->default_dst.remote_ifindex;
int ret;
int ret = -EINVAL;
lock_sock(sk);
if (ip->sa.sa_family == AF_INET) {
......@@ -1121,7 +1121,7 @@ static int vxlan_igmp_leave(struct vxlan_dev *vxlan)
struct sock *sk = vs->sock->sk;
union vxlan_addr *ip = &vxlan->default_dst.remote_ip;
int ifindex = vxlan->default_dst.remote_ifindex;
int ret;
int ret = -EINVAL;
lock_sock(sk);
if (ip->sa.sa_family == AF_INET) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册