Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp557931ybz; Fri, 24 Apr 2020 05:24:26 -0700 (PDT) X-Google-Smtp-Source: APiQypJlGT2O/S6tYD3AfO42MUkIe9hfLHWi3HMN4ebgeCoDvnYSPRITQyB5hrx/zWG+sZ+c0MWI X-Received: by 2002:a17:906:cec5:: with SMTP id si5mr6934463ejb.267.1587731066070; Fri, 24 Apr 2020 05:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731066; cv=none; d=google.com; s=arc-20160816; b=T892UDPxDCFgTUbF2h2JWLtVVfVdFyZxdgR5KFozGnDDqd9W1HxZhAQ1LzjyT+wc2Y jpZ5IMqTRM27U8aP6vriAwYIxme7agD6LtSj8g2NYdc3vm++6gJQ5NFuDCUP0EcxGFbg Nex0D54+2jRC9suKJ3z7sFurmuunKewYmlmG7QYp5M+g5OjTcyIyVt59h1tKuBA0QD/8 iFKwWcWRJn4rKY5wcA9XlKxeZiQfHef8yavULtqCOcU8O48wkjpsUbsZrmf+5mlj+N6r A+K1XK2SQUrV+jxSA/UHUdzDsnqtTFZaAS0k5AElRpi4OiMHyocMu1/1IvQh9Rtb3izp eiqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1LZBKzRmCcMeYOyA/Q96ba91X9SsaMRIKKmhVOoR78s=; b=nkX5+tYfphTYRDVdTfsGYwYoe0ZnJqtiQlrAFLsbyb13bCCk0zZ97Tx3pJZWQGShnR qKxbaeHi/OIhMiwZu5tlmzqNAEcx+7Ndtbhy9LJ/skxZY9KoeUd1ubtM1ad4hrdiLnQm IQhgm9/AB3YRxA+qTTKnJZDgPVzuslAIe3XDIKaJ1tD/nnrxHfdMe83uOcSSag69y+vN YM5KUzCMKLeDRSaHwOhzYS7DcmX4XKVNf+lc3SM+BSWVYvNDDiav5fTzlbo8Q53E1jdP E7DnUGeCGBfIeoOnCrALuDoMwSgwQh1UqEnMCFvWfcF629cuq4kdLEj3AnkdpLkJ5qGY zoQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="p5q/b3s/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk10si2978317edb.3.2020.04.24.05.24.01; Fri, 24 Apr 2020 05:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="p5q/b3s/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726941AbgDXMWk (ORCPT + 99 others); Fri, 24 Apr 2020 08:22:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:51764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgDXMWj (ORCPT ); Fri, 24 Apr 2020 08:22:39 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4400520700; Fri, 24 Apr 2020 12:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730959; bh=5b/Hr7JmNEoV7AggX58A4+LBvaJWtT4/EzL/fqNixHM=; h=From:To:Cc:Subject:Date:From; b=p5q/b3s/dVIRwYkPrDZR3o/6f/+m+Fd5c/yDmMbWgd5ebHddcJiWq9cnDDhdPkFgR Do/J/oeQ8HCRuEosxqJivDE8SjKeAgLHi/ZYBOHuhd5HuuqHCDaAbC1WN9GDs0+sEz ZXggslJnwxDZiOINGA9ZSai0aZvkHMtE2GOF3yao= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jeremy Cline , Daniel Borkmann , Andrii Nakryiko , Sasha Levin , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.6 01/38] libbpf: Initialize *nl_pid so gcc 10 is happy Date: Fri, 24 Apr 2020 08:21:59 -0400 Message-Id: <20200424122237.9831-1-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 6d47345a310bd..b294e2aeb3283 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