vxlan: hide unused local variable

Message ID 20161107211017.857340-1-arnd@arndb.de
State New
Headers show

Commit Message

Arnd Bergmann Nov. 7, 2016, 9:09 p.m.
A bugfix introduced a harmless warning in v4.9-rc4:

drivers/net/vxlan.c: In function 'vxlan_group_used':
drivers/net/vxlan.c:947:21: error: unused variable 'sock6' [-Werror=unused-variable]

This hides the variable inside of the same #ifdef that is
around its user. The extraneous initialization is removed
at the same time, it was accidentally introduced in the
same commit.

Fixes: c6fcc4fc5f8b ("vxlan: avoid using stale vxlan socket.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

 drivers/net/vxlan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index cb5cc7c03160..5264c1a49d86 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -944,7 +944,9 @@  static bool vxlan_group_used(struct vxlan_net *vn, struct vxlan_dev *dev)
 	struct vxlan_dev *vxlan;
 	struct vxlan_sock *sock4;
-	struct vxlan_sock *sock6 = NULL;
+	struct vxlan_sock *sock6;
 	unsigned short family = dev->default_dst.remote_ip.sa.sa_family;
 	sock4 = rtnl_dereference(dev->vn4_sock);