summaryrefslogtreecommitdiff
path: root/drivers/net/bareudp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-02-24 14:40:54 -0800
committerDavid S. Miller <davem@davemloft.net>2020-02-24 14:40:54 -0800
commitc102b6fddcab89cc6a17c43f8b731e2c9f29b88a (patch)
tree43e528499a93cdae59e3e253404e5ebda0540b6b /drivers/net/bareudp.c
parent8bf2464c47f040d9325724ac8ac4fe6ef55e2f83 (diff)
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>
Diffstat (limited to 'drivers/net/bareudp.c')
-rw-r--r--drivers/net/bareudp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 77e72477499d..15337e9d4fad 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -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;