From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,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 BDCE9C4724C for ; Fri, 1 May 2020 13:43:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EE4E208C3 for ; Fri, 1 May 2020 13:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588340628; bh=cvpfkKl0re23dbSIZPGfq2IJOeBQhXopC+2zHEgTZCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=s30R9WKJvcTudeOwGIrJWplt2xXxBPFdHKwhUdPNx928Ph+qIdfYMBo2JcMJTYeTV pl5Iy4dHX2FrRCFAZDP07Kw8AhqJk0r733EOz8QYvDDyNQhxLzexU7ArMN/aWgTyUz C2cn/N4UlX5Z33Kn0+nVYWS8ilqwNA8uzVADt8w0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731201AbgEANnr (ORCPT ); Fri, 1 May 2020 09:43:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:44618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731661AbgEANnk (ORCPT ); Fri, 1 May 2020 09:43:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A07E52051A; Fri, 1 May 2020 13:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588340620; bh=cvpfkKl0re23dbSIZPGfq2IJOeBQhXopC+2zHEgTZCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JgRvWmPdAdZCDiP9VlU7hmYIgXKqG54lNFswhcY3A2VErfAdz316v2BVYWbhj8pFD U56R5/aFgWGF1k3NW2m39M0H3uM9bACyMBKwEvrxgZBtuvjTjvLDIb+7/2YILcaAIE S6I2mMypMvEUlWOcG8Vh43qfbiSVWJ4a1MlnBq0o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremy Cline , Daniel Borkmann , Andrii Nakryiko , Sasha Levin Subject: [PATCH 5.6 068/106] libbpf: Initialize *nl_pid so gcc 10 is happy Date: Fri, 1 May 2020 15:23:41 +0200 Message-Id: <20200501131552.474933327@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131543.421333643@linuxfoundation.org> References: <20200501131543.421333643@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeremy Cline [ Upstream commit 4734b0fefbbf98f8c119eb8344efa19dac82cd2c ] Builds of Fedora's kernel-tools package started to fail with "may be used uninitialized" warnings for nl_pid in bpf_set_link_xdp_fd() and bpf_get_link_xdp_info() on the s390 architecture. Although libbpf_netlink_open() always returns a negative number when it does not set *nl_pid, the compiler does not determine this and thus believes the variable might be used uninitialized. Assuage gcc's fears by explicitly initializing nl_pid. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1807781 Signed-off-by: Jeremy Cline Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20200404051430.698058-1-jcline@redhat.com Signed-off-by: Sasha Levin --- tools/lib/bpf/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/netlink.c b/tools/lib/bpf/netlink.c index c364e4be5e6eb..c1a7fc1859401 100644 --- a/tools/lib/bpf/netlink.c +++ b/tools/lib/bpf/netlink.c @@ -141,7 +141,7 @@ int bpf_set_link_xdp_fd(int ifindex, int fd, __u32 flags) struct ifinfomsg ifinfo; char attrbuf[64]; } req; - __u32 nl_pid; + __u32 nl_pid = 0; sock = libbpf_netlink_open(&nl_pid); if (sock < 0) @@ -256,7 +256,7 @@ int bpf_get_link_xdp_info(int ifindex, struct xdp_link_info *info, { struct xdp_id_md xdp_id = {}; int sock, ret; - __u32 nl_pid; + __u32 nl_pid = 0; __u32 mask; if (flags & ~XDP_FLAGS_MASK || !info_size) -- 2.20.1