aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/filter.c
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2019-03-23 12:23:07 -0400
committerAlexei Starovoitov <ast@kernel.org>2019-03-24 15:31:57 -0700
commit62b31b42cff924c7d1e9a095b68ff3bbfc49b15b (patch)
tree1db3163ba2f023f753054bd45f4976aae57eba8c /net/core/filter.c
parentselftests: bpf: tc-bpf flow shaping with EDT (diff)
downloadlinux-dev-62b31b42cff924c7d1e9a095b68ff3bbfc49b15b.tar.xz
linux-dev-62b31b42cff924c7d1e9a095b68ff3bbfc49b15b.zip
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: 868d523535c2 ("bpf: add bpf_skb_adjust_room encap flags") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/core/filter.c')
-rw-r--r--net/core/filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 0a972fbf60df..22eb2edf5573 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2975,8 +2975,8 @@ static int bpf_skb_net_grow(struct sk_buff *skb, u32 off, u32 len_diff,
u64 flags)
{
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;
- u16 mac_len, inner_net, inner_trans;
int ret;
if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) {