From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B822A35BDB4; Wed, 3 Dec 2025 16:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778965; cv=none; b=J9j0a8nN5N4BxDDiPTXRpjRzDN7p9BCZl9gD4V5BzqOLx3PR2jfaTb29Ym0qikYELxoo1YQHtMYWcZgDoP7RbFa90EE8XFrvHqGvsXpbRnrQeMKsu6mYTgywWySzDRXGIlDIsX7hPvyhgVaTSr/gtAqB2NQ5FNNM1WFGD6PkG1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778965; c=relaxed/simple; bh=UaDqP+Y3LulkfP5Df5LRb0JECP51SIHA3F86/X4aZ1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U3ELUOmtfjHJnGwiTMJHWRten4VT3sMq1mavZrdI1HounPHdyoHrDVKXZ1oQTwaG9cZJHVtgWNfxgVOcEv7E6Q9EBczzwbavhL2sYSMeQnTCBY7g+AZBQuKIeJ6mFKBJPJPGXO2SiibOYJZ2iVX23syf+YeoeruVe5bsP/jxIY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YMXGhbWV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YMXGhbWV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6080C4CEF5; Wed, 3 Dec 2025 16:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764778965; bh=UaDqP+Y3LulkfP5Df5LRb0JECP51SIHA3F86/X4aZ1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMXGhbWVsrftK777zMqsxINOtC+KQQjKKoMJCTNUKNB5ycXkee0GD7pxKoogopRjR 2IuoWl5xWJ1OI9YUdzSpwddN8aGrMByQyJrxrL1MqCPBOY9Lg5odf5xGCAonX8LYBf T3bbVePcDA44ZWUMjjidZtCYTOd1JFQtJyXvNIiM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tom Stellard , Andrii Nakryiko , Quentin Monnet , Sasha Levin Subject: [PATCH 6.1 115/568] bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 Date: Wed, 3 Dec 2025 16:21:57 +0100 Message-ID: <20251203152444.947075244@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152440.645416925@linuxfoundation.org> References: <20251203152440.645416925@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tom Stellard [ Upstream commit 5612ea8b554375d45c14cbb0f8ea93ec5d172891 ] This fixes the build with -Werror -Wall. btf_dumper.c:71:31: error: variable 'finfo' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 71 | info.func_info = ptr_to_u64(&finfo); | ^~~~~ prog.c:2294:31: error: variable 'func_info' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer] 2294 | info.func_info = ptr_to_u64(&func_info); | v2: - Initialize instead of using memset. Signed-off-by: Tom Stellard Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20250917183847.318163-1-tstellar@redhat.com Signed-off-by: Sasha Levin --- tools/bpf/bpftool/btf_dumper.c | 2 +- tools/bpf/bpftool/prog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c index 19924b6ce796f..56100ad2fa0d2 100644 --- a/tools/bpf/bpftool/btf_dumper.c +++ b/tools/bpf/bpftool/btf_dumper.c @@ -38,7 +38,7 @@ static int dump_prog_id_as_func_ptr(const struct btf_dumper *d, __u32 info_len = sizeof(info); const char *prog_name = NULL; struct btf *prog_btf = NULL; - struct bpf_func_info finfo; + struct bpf_func_info finfo = {}; __u32 finfo_rec_size; char prog_str[1024]; int err; diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 1c3dc1dae23f6..e158e010266d5 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -2104,7 +2104,7 @@ static void profile_print_readings(void) static char *profile_target_name(int tgt_fd) { - struct bpf_func_info func_info; + struct bpf_func_info func_info = {}; struct bpf_prog_info info = {}; __u32 info_len = sizeof(info); const struct btf_type *t; -- 2.51.0