Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2059180imn; Mon, 1 Aug 2022 09:36:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR5qTNy74uerEwVe+5F8C6GhM4xGlhoFB03MWiDIOL6GsaksJwheTUrfO0UKtv4KtHk2Hd2Q X-Received: by 2002:a17:907:6daa:b0:730:8ef6:9c6b with SMTP id sb42-20020a1709076daa00b007308ef69c6bmr3099136ejc.6.1659371779209; Mon, 01 Aug 2022 09:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659371779; cv=none; d=google.com; s=arc-20160816; b=JjxD+VfR2HC3p8irrCRSwAhpHYhRf2mh5UZdJQsqeybgDwNJB0cswWvvdtUetGHYCo 8y8apbZnauR4Q1eoRTxUW4M6pIsRGpXGpe8eUn8byinaDl9NUv6TCvdBqbZ37WB91yKs 3R4SvB9kQVdGx5z70I7L4h8nVZw1BI7E0ZVRueV9icA3GfVq7FwNmDw6td2ms1JKvOhr rVLFzzzKqHo4UebPaOOBv1SIR0q8MW/9rC6k6zlV7byPdpZFzSqCt7nYTpyApyQ0sl4L W9oni3nGPZ/gBvtGMP4L9VONik2W//EkXgX+f7QC/7oby3HmjSttcCaSijPUUmbVgmCv ZwMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=wcy/rcdKHUsNf9tppWBLadn82oSwXUzbkvBCll0A8mA=; b=kGR91Pl6TEWiRrs32UHQHgyeK6bkNRfD9sW7kKNNTd0dMTwKS/HaoBeVFHard/cMsk u2A97v36lWE1GQ/YghrJtABFv8JB3OIQR5CIYgB7rMwxz4gFbHgTnMeLVP4RLU02V+mS /SAy7cuKdS1+cUZKaWqL2vh5EHgdeRG+uP8eQhFP7wYDx29CO3JvEBivsVyy2m7/SDtI kdqFaKWbhgz0cv379MGxdJMjWLgU9jCRRADy35zyDvw08kGBJydeYZh3WdP2PaeCPVIn bnODT96PqIas8WZfzQ8k01SwB/+qSP5pftTEdAn+nPnnFzyA6y+kD0WLjRZD0K8KfbzW ZVeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TLv1gSxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wg10-20020a17090705ca00b0072f2e1425a3si2118732ejb.774.2022.08.01.09.35.53; Mon, 01 Aug 2022 09:36:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TLv1gSxX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbiHAQZR (ORCPT + 99 others); Mon, 1 Aug 2022 12:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbiHAQZO (ORCPT ); Mon, 1 Aug 2022 12:25:14 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65EAEB9F; Mon, 1 Aug 2022 09:25:12 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id tk8so21313377ejc.7; Mon, 01 Aug 2022 09:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc; bh=wcy/rcdKHUsNf9tppWBLadn82oSwXUzbkvBCll0A8mA=; b=TLv1gSxXzDStTb6ykAHt11EaqHfK+pLXvcQHlAj3SlnO/ZMxskqKqEx79KFChNByi4 nlN9ZzgoIA3qDwW3n2p0zP6YXyeb2XyI2oHdu7fqem/c9ulb1JK4yOUWGkUMG6t5jp+G nMoY/RFCK+cr+HQc+9CqJ1GSlKyNqSXXVzvYDM2KBzfGFVpbdHnAM8nTAFh10yYIYh4Y quD5rXmZO7lLZe6GuDWtmVxXu6vrKTjCXh5sAs5JajY/y2Y0Fje7JvE391oDfKscVDPV rnQfm01JZBNSxqdWqO9aBIQtJFh43fZITEfy3QiYiRFEK2fzKlenATobXJ1NXtDzSnKz 47Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc; bh=wcy/rcdKHUsNf9tppWBLadn82oSwXUzbkvBCll0A8mA=; b=P1BuZLwzjEJnwFpSQ5hTnxoh5gIc5JQIDkkowbQPpV2fM2MKjhknqDbW390sfpzGT9 CAdfczm6gl2QZ1WrmeYhlWxB2oGhBRSvChLpBJVnl0iweJvSshIYiGDyFm91DJs6Gl7Y DZ5vgPti2dIEBP/gy6rQrdSv5zdp+BXFsPWvdsPkAMQIeb5jIPdpCS2m3xSamUWRJwaH I1Fe46JEx7M7Rw887s6Foe/QccJnh0JRFCXpQJFD3XFlXrI2+UyqHLRddtjPDREM0AXP Sm6sT2egRuJzx+zyEhhs1DSy0P55nYHL5toyYeBEg26nF+r3ZI/LBhdYRJ022PbNCFLF p98w== X-Gm-Message-State: AJIora/oh0EmY4woG4sn/7tGJi3unMylw3rPUOeOIMwHlfhqgf7qkk6m 6RhRErH8kqckPmtWaa/rv78= X-Received: by 2002:a17:906:8501:b0:711:bf65:2a47 with SMTP id i1-20020a170906850100b00711bf652a47mr13389539ejx.150.1659371110880; Mon, 01 Aug 2022 09:25:10 -0700 (PDT) Received: from krava ([83.240.62.89]) by smtp.gmail.com with ESMTPSA id e15-20020a50fb8f000000b0043a6df72c11sm6918178edq.63.2022.08.01.09.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 09:25:10 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Mon, 1 Aug 2022 18:25:07 +0200 To: Florian Fainelli Cc: bpf@vger.kernel.org, Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Dave Marchevsky , open list Subject: Re: [PATCH] libbpf: Initialize err in probe_map_create Message-ID: References: <20220801025109.1206633-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220801025109.1206633-1-f.fainelli@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 31, 2022 at 07:51:09PM -0700, Florian Fainelli wrote: > GCC-11 warns about the possibly unitialized err variable in > probe_map_create: > > libbpf_probes.c: In function 'probe_map_create': > libbpf_probes.c:361:38: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] > 361 | return fd < 0 && err == exp_err ? 1 : 0; > | ~~~~^~~~~~~~~~ > > Fixes: 878d8def0603 ("libbpf: Rework feature-probing APIs") > Signed-off-by: Florian Fainelli Acked-by: Jiri Olsa jirka > --- > tools/lib/bpf/libbpf_probes.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/lib/bpf/libbpf_probes.c b/tools/lib/bpf/libbpf_probes.c > index 97b06cede56f..6cf44e61815d 100644 > --- a/tools/lib/bpf/libbpf_probes.c > +++ b/tools/lib/bpf/libbpf_probes.c > @@ -247,7 +247,7 @@ static int probe_map_create(enum bpf_map_type map_type, __u32 ifindex) > LIBBPF_OPTS(bpf_map_create_opts, opts); > int key_size, value_size, max_entries; > __u32 btf_key_type_id = 0, btf_value_type_id = 0; > - int fd = -1, btf_fd = -1, fd_inner = -1, exp_err = 0, err; > + int fd = -1, btf_fd = -1, fd_inner = -1, exp_err = 0, err = 0; > > opts.map_ifindex = ifindex; > > -- > 2.25.1 >