mirror of
https://github.com/torvalds/linux.git
synced 2024-12-04 18:13:04 +00:00
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:
parent
8bf2464c47
commit
c102b6fddc
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user