From patchwork Wed Oct 19 08:25:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp350490wrs; Wed, 19 Oct 2022 07:13:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5nCEkJI9ru2DUQ1360B88N5S20LHI3lnh6t3X1s8mmtntl1u/ybozLTJ0hUscgvmF8w7l5 X-Received: by 2002:a17:907:701:b0:780:2c44:e4dd with SMTP id xb1-20020a170907070100b007802c44e4ddmr7114957ejb.589.1666188827192; Wed, 19 Oct 2022 07:13:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188827; cv=none; d=google.com; s=arc-20160816; b=YQ+e5ha/hmNSQ5N9NxgFXOS9FvuuWSq4F5S/veAja6X51avDBs4Zhvd4WzumpV15F0 MF96l/BwpjAMrIBjDCJWAWrhYPWVw4nobLxWnFvJlvk+GZFsAbWLU5LwAOM/qkng+SEB QH30lhYdW7OFHrmcnJuu08xDKdxXj5aLL7888+4XHENZLoiSn8VBWyaXI2W1K/1kKzCx yyeZfsY3uq7UJHtxG0M6PoYIkvZg0Zpz6keQMT8KEGHTQ8/wcFGy0KmQg4/p0WNkyBVI EiW/Ei3tT0aVUVe7zQn71uJxtN4hu9b0rC1GmriY0DXQftidmowRBAGuymZ84kYqALTQ EkgA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lHZ66outyL92VwSAmP0g5ntTSDES40/cXDkBB/VMSXE=; b=aWj06hEzGMA8dY/D79Qum4HyvAw/XeOhjX/eUYjdYEvqpr4nV9q0n97XiI1UduIsbn PVMkj4dw/+JCXxmjQrf+A57bLb/WtKltpBnwxdhVZ7Fqctcq8HQDGO8BMIpYzFYHkqnz B/f8nlfLqmpA2uXjV0ndLYUosc/IHcACsPlIiH4n7BujzxG2FiVO1px5W0jMUQ5q6CxP N1ODVIB8CkyCHdCxgmd52AG04xMRrAKl2c3JrjFcOjU8GxHcN7ExDFe/nNWX7DUuIEcG 7B/YVeBqqSYPZPhtd7kA9LzcP8+Cho74y2q7ZuWMUBpd6mblRsPeUYKDr6uMMUnpTjMy d5nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uV7GoQ5k; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a1709063a0900b00769d94690fesi12627534eje.326.2022.10.19.07.13.17; Wed, 19 Oct 2022 07:13: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=@linuxfoundation.org header.s=korg header.b=uV7GoQ5k; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233029AbiJSN6w (ORCPT + 99 others); Wed, 19 Oct 2022 09:58:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234146AbiJSNzQ (ORCPT ); Wed, 19 Oct 2022 09:55:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E8A817C55F; Wed, 19 Oct 2022 06:37:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 38E79B82326; Wed, 19 Oct 2022 08:48:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87E87C433C1; Wed, 19 Oct 2022 08:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169307; bh=gdVxvXTVsxzy2ljfw76jvEClmWnODYkAY5VxrKNgL8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uV7GoQ5kkpRe81u7hX9qWdRRVxsyu+X5A9zKz6ugVCuVeYdhY9wBcrnBccA/wRBX3 DaspGzUd80ZhAmI9Rq4juO+6HMVzlVaCMUSEd+SKLMDlIxJIKnZLtgjiAz7tq043N8 s25gUYWhNz1TALSDVpLCew1sdplCnBy0dAlwA+so= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Andrii Nakryiko , Jiri Olsa , Sasha Levin Subject: [PATCH 6.0 228/862] libbpf: Initialize err in probe_map_create Date: Wed, 19 Oct 2022 10:25:15 +0200 Message-Id: <20221019083300.143314598@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747125616050282110?= X-GMAIL-MSGID: =?utf-8?q?1747125616050282110?= From: Florian Fainelli [ Upstream commit 3045f42a64324d339125a8a1a1763bb9e1e08300 ] 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 Signed-off-by: Andrii Nakryiko Acked-by: Jiri Olsa Link: https://lore.kernel.org/bpf/20220801025109.1206633-1-f.fainelli@gmail.com Signed-off-by: Sasha Levin --- 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 0b5398786bf3..6d495656f554 100644 --- a/tools/lib/bpf/libbpf_probes.c +++ b/tools/lib/bpf/libbpf_probes.c @@ -193,7 +193,7 @@ static int probe_map_create(enum bpf_map_type map_type) 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; key_size = sizeof(__u32); value_size = sizeof(__u32);