Commit 62b31b42 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by Alexei Starovoitov

bpf: silence uninitialized var warning in bpf_skb_net_grow

These three variables are set in one branch and used in another with
the same condition. But on some architectures they still generate
compiler warnings of the kind:

  warning: 'inner_trans' may be used uninitialized in this function [-Wmaybe-uninitialized]

Silence these false positives. Use the straightforward approach to
always initialize them, if a bit superfluous.

Fixes: 868d5235 ("bpf: add bpf_skb_adjust_room encap flags")
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 7df5e3db
...@@ -2975,8 +2975,8 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 off, u32 len_diff, ...@@ -2975,8 +2975,8 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 off, u32 len_diff,
u64 flags) u64 flags)
{ {
bool encap = flags & BPF_F_ADJ_ROOM_ENCAP_L3_MASK; bool encap = flags & BPF_F_ADJ_ROOM_ENCAP_L3_MASK;
u16 mac_len = 0, inner_net = 0, inner_trans = 0;
unsigned int gso_type = SKB_GSO_DODGY; unsigned int gso_type = SKB_GSO_DODGY;
u16 mac_len, inner_net, inner_trans;
int ret; int ret;
if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) { if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) {
......
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