Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CE41C43381 for ; Sat, 23 Mar 2019 16:23:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBE0720896 for ; Sat, 23 Mar 2019 16:23:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jyBT9sbU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727544AbfCWQXM (ORCPT ); Sat, 23 Mar 2019 12:23:12 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:37179 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727267AbfCWQXM (ORCPT ); Sat, 23 Mar 2019 12:23:12 -0400 Received: by mail-qk1-f195.google.com with SMTP id c1so3022666qkk.4 for ; Sat, 23 Mar 2019 09:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=svu0Xnuo2EYtimpesU+WocNbyTlv4I7vp3LKYdZ2U2k=; b=jyBT9sbU6FMoKdGbHxEwIubxLvAdP7TspyV5GAMr0mSBq2R7NH9Jbn8L31z3xDp+c3 Km4nUUM2qHzR+F03zqg9yuKMaI1fh0XVW1YJxyyAbtzpY6JF1urE2eePwDXhWI//2PHt lh08GofW9hRcgTqbwmIgJfXv78yeVM3kz08OUigzlQj1KTEvPUrD2IWITzpHii4VyzYW XjIM3gGd5ukwMVS/c8YirjeJv3KYoODoMxbFK+//xxtxB4ng68beso5EydhUAn38Edmk gP83EqAjuUbh46fMavAzFsCN8UgU2LkpmU+4TXK3B6Kew7whdh8nQwEjL0nq2EaFhFPh KIFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=svu0Xnuo2EYtimpesU+WocNbyTlv4I7vp3LKYdZ2U2k=; b=lRrRAGPMsms+JlPwNnrWdwc5kAU5af+zlzP/4SAEtxztxuRMjVr3fD/WAxjhOfUmcQ W2BFNgcv5jaeDl94dmQOIGkV9ZGPyN+z/y1pYnX2rPlt1HxvDVGh/mesX2JGNns5MXZC d/be1mbQAOxy8aTf9KJoZT07apRXbZN8WSVvzWkPtFWmPwNZYWuLJYZWse281maQOn9u Dh2l59zC77eMLN3xVqYYOC6B2hoytxmjcTG3c3zLyoE5/hbq+r3/UIDamI9beBtmhvF7 2FF2bUKn7yoBl/JO2bvHQJqSKshs201xEMxrOUHiG+iu6YZ/MsmomIg/AxbyR0xoice/ gx5A== X-Gm-Message-State: APjAAAWyEMuzoA4V9NcJ33sO7kK9bDUKMdNc0obTcZBaDWjL3E4z1ZI5 b0MDYhF7+qAcG1tlsdRajrTPAJmP X-Google-Smtp-Source: APXvYqxXaVV13Hn5drE1aYsRmNXevy2ArEZzei0iQRacdatHF9pIIqu5gtDPVLA0t4DaS49TXQ8V4g== X-Received: by 2002:a37:8285:: with SMTP id e127mr13015778qkd.182.1553358190588; Sat, 23 Mar 2019 09:23:10 -0700 (PDT) Received: from willemb1.nyc.corp.google.com ([2620:0:1003:315:3fa1:a34c:1128:1d39]) by smtp.gmail.com with ESMTPSA id k42sm10207850qtk.58.2019.03.23.09.23.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 09:23:09 -0700 (PDT) From: Willem de Bruijn To: netdev@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, Willem de Bruijn , kbuild test robot Subject: [PATCH bpf-next v2] bpf: silence uninitialized var warning in bpf_skb_net_grow Date: Sat, 23 Mar 2019 12:23:07 -0400 Message-Id: <20190323162307.243049-1-willemdebruijn.kernel@gmail.com> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Willem de Bruijn 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 Signed-off-by: Willem de Bruijn -- v1->v2: add missing word in fixes tag --- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- 2.21.0.392.gf8f6787159e-goog