Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1731122imn; Sun, 31 Jul 2022 20:06:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cmkk6eyh1mKHA9i9eUU+sA6Fbm4fFnIEfRlKF4vRfdOK/J56ST4/6F3diLtLv9IuIS1kY X-Received: by 2002:a62:834e:0:b0:52d:2bb9:8c2c with SMTP id h75-20020a62834e000000b0052d2bb98c2cmr7398384pfe.42.1659323207310; Sun, 31 Jul 2022 20:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659323207; cv=none; d=google.com; s=arc-20160816; b=UmHJoE4Vvsg4ZRkwNp7hVtow8+hKsp7blVvH6rG0OySrkaOMBPHYDm4OlVFYy6NtfF BFZ3BJmOkyoRDT6NBpPjunKhXvt+SCBNKAr0NcU2ao5xVHLaiwkczMaplCygZ7J/dsmJ hdDPJAVpkuQACtCZgtyTbUdHxP21rumr8roLwKMd3QsMRNjn6VKtMsm/oSqwkn8hRaZ5 CVeRb4IPCLwxZV8kq7o+6U1DbX04M/Dyqmh98Hlqn6au+YgjmNnScVR2mrQ35Q7G4F+v SYKY9PaD1jJcRaonOStvW7N34ASDLvty2VA4eoz6fDpuy97fpkCQ2w1gcXM8odyANnVG TkVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=E5/3EPPmTChoHJEmcg7iZTYAVeMR8tAQMUhwyuotXUs=; b=Rul9EYXTPd4U2Hlv0a9AL3TyydIm4QKVWaXyLVr4KfheLygaL7/Kbm+PA99SdLh41j MsClUtu78d6OFxloaOtMZBbqHHECF3nvKz1QahqQJZIkOz8V8LEuc88Lb2MK148Sn86z uiLryGsRsh565LS2I+/20tQ+2ZUNhJs5KzhFLLeLO1r/1SL6LkFuHRJft7n79P0pJOfc oPzrqSaWjnmsg+Io8ti61D3M539x9r/U5UfZQ/kZk+sM/MLy3ADv/i4cIRKygqRXvrvN /igatqTEAQpSrFXECPuKAjHlxKHQkPAGZAc7M3uFAmGbJ+mDwZpBRaxlerLlqBbogxP/ p0VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=biEgmbwd; 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 e19-20020a635453000000b003fdcf4695c8si12320768pgm.400.2022.07.31.20.06.33; Sun, 31 Jul 2022 20:06:47 -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=biEgmbwd; 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 S239398AbiHACvW (ORCPT + 99 others); Sun, 31 Jul 2022 22:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239324AbiHACvU (ORCPT ); Sun, 31 Jul 2022 22:51:20 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA81A7671; Sun, 31 Jul 2022 19:51:18 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id q19so44014pfg.8; Sun, 31 Jul 2022 19:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=E5/3EPPmTChoHJEmcg7iZTYAVeMR8tAQMUhwyuotXUs=; b=biEgmbwdEA6v7Wkbp8qvSR0KX5HVzyDXwGAA7hr4BP7zacsvJsElUKIJ5VraGv+f3L PX32CeZGzTD6wzCRr4uxTis8ijaiz+86HM70pUYAToWN9toVKYgV1xu0SVBUYqJWQCle aD3Bh+O21nm5RycgkhHCfD+EN5SGyGZ868y6EAQVb4mfG7ALdEWtwxC/MvY1ebRFgCsD roEiC+uJ2HPWfzJAKy3yLQzmQ/QOM/rlZiRURDB+6oGqSfKRPr1aLYLXtfMFX2ZBsVvY 7jDw9cnnuUsSffV8Gr3625pc/k3FQZFadoGzD6DcSbV2vKVzXNysHkIC3zz1Tbue/slD rBYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=E5/3EPPmTChoHJEmcg7iZTYAVeMR8tAQMUhwyuotXUs=; b=iznhs9VP4+w28zJuqaaseiLRHJqbVaPvgGfliKnXGJrrxN6EnFRkGUW8ZJ6sScdcfR rFq69aszanOeefIDwz916MqvG0DYrDN69BWipeSY6e8Q7O5R8aF4NrjRgr8wP25RGkFj QWtrW1vji6Zxfmo6ZakM7m+QwvZsk6IuMKccalCWcz95+7bY4QFjE3USKKkFt3lIYv/+ VQzwnEq96oHRFhDDRFW5I3WcXN1bZb5w1MM5g6uGvlbNqgRc+JeaY4eV0T/uEkC+L3zi xU/5pV7fWCYnOXh0+Ws48lIH1JP1mIVb5Rq5bUg9tUr87WDTRYmj4LR5qOQ0vRIPHn15 7A9Q== X-Gm-Message-State: AJIora86uYrEk5xNQVN+v+y0poetPW2D2/FnIGTf4wtz0z6KSFUQfSWi Ju6lg74Vm15Aj7CvdqZSbSrkN0x4XAI= X-Received: by 2002:a63:f207:0:b0:41b:6137:2b6d with SMTP id v7-20020a63f207000000b0041b61372b6dmr11651724pgh.397.1659322278084; Sun, 31 Jul 2022 19:51:18 -0700 (PDT) Received: from localhost.localdomain (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b0016db7f49cc2sm8132666plg.115.2022.07.31.19.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jul 2022 19:51:17 -0700 (PDT) From: Florian Fainelli To: bpf@vger.kernel.org Cc: Florian Fainelli , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Dave Marchevsky , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] libbpf: Initialize err in probe_map_create Date: Sun, 31 Jul 2022 19:51:09 -0700 Message-Id: <20220801025109.1206633-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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