From: Marcelo Ricardo Leitner Date: Fri, 20 Mar 2015 13:26:21 +0000 (-0300) Subject: vxlan: fix possible use of uninitialized in vxlan_igmp_{join, leave} X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=149d7549c22045bc777a377720809b108639f9e9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller --- 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) 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) {