Commit 0f1b7354 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by David S. Miller

vxlan: Refactor vxlan_udp_encap_recv() to kill compiler warning

drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this function

While this warning is a false positive, it can be killed easily by
getting rid of the pointer intermediary and referring directly to the
ip_tunnel_info structure.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: default avatarJiri Benc <jbenc@redhat.com>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99c79ece
...@@ -1223,7 +1223,6 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb, ...@@ -1223,7 +1223,6 @@ static void vxlan_rcv(struct vxlan_sock *vs, struct sk_buff *skb,
static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{ {
struct metadata_dst *tun_dst = NULL; struct metadata_dst *tun_dst = NULL;
struct ip_tunnel_info *info;
struct vxlan_sock *vs; struct vxlan_sock *vs;
struct vxlanhdr *vxh; struct vxlanhdr *vxh;
u32 flags, vni; u32 flags, vni;
...@@ -1270,8 +1269,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) ...@@ -1270,8 +1269,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
if (!tun_dst) if (!tun_dst)
goto drop; goto drop;
info = &tun_dst->u.tun_info; md = ip_tunnel_info_opts(&tun_dst->u.tun_info);
md = ip_tunnel_info_opts(info);
} else { } else {
memset(md, 0, sizeof(*md)); memset(md, 0, sizeof(*md));
} }
...@@ -1286,7 +1284,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) ...@@ -1286,7 +1284,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
md->gbp = ntohs(gbp->policy_id); md->gbp = ntohs(gbp->policy_id);
if (tun_dst) if (tun_dst)
info->key.tun_flags |= TUNNEL_VXLAN_OPT; tun_dst->u.tun_info.key.tun_flags |= TUNNEL_VXLAN_OPT;
if (gbp->dont_learn) if (gbp->dont_learn)
md->gbp |= VXLAN_GBP_DONT_LEARN; md->gbp |= VXLAN_GBP_DONT_LEARN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment