bareudp: Fix uninitialized variable warnings.

drivers/net/bareudp.c: In function 'bareudp_xmit_skb':
drivers/net/bareudp.c:346:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  346 |  return err;
      |         ^~~
drivers/net/bareudp.c: In function 'bareudp6_xmit_skb':
drivers/net/bareudp.c:407:9: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
  407 |  return err;

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2020-02-24 14:40:54 -08:00
parent 8bf2464c47
commit c102b6fddc

View File

@ -320,6 +320,7 @@ static int bareudp_xmit_skb(struct sk_buff *skb, struct net_device *dev,
df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
skb_scrub_packet(skb, xnet);
err = -ENOSPC;
if (!skb_pull(skb, skb_network_offset(skb)))
goto free_dst;
@ -381,6 +382,7 @@ static int bareudp6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
skb_scrub_packet(skb, xnet);
err = -ENOSPC;
if (!skb_pull(skb, skb_network_offset(skb)))
goto free_dst;