Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2077681ybp; Thu, 10 Oct 2019 01:47:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvJP2wlvhKczhna/kzniz4gGur1aXCNj4Fpt+vLbzCoRHOWeNsQUldnV/ux+KPNgRdYUCj X-Received: by 2002:a05:6402:557:: with SMTP id i23mr6969358edx.71.1570697233623; Thu, 10 Oct 2019 01:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697233; cv=none; d=google.com; s=arc-20160816; b=ojfVueRRtcE2qHn/HrtRMht3ai/TPoqJhtoMLRmm+4Ru7uCRqn3udxwBs35NCLpHLI bnX0TgbLPTOlNugyw5rCHGpmNucR0MqojmeQtBaWDBgQY+jo9nre6Ozue+Yrj7WV+Tgh Vweb4OUN5iif44UlQqCwC6oy2wav5qGyYy7MvN4ocOen1RwxV6LwPtyx9x44XeBDVs9h CD1at7k0dnjSPinK9wK6HA/oC/jvxMrV4eVZpOIvCDUva0AWc4cpgFeWVjunXheo+6TG jzvPuJ5/9u6UC4U+sCW/E8vw80HzlmCkO01a0IhoNgVy8hijuItnakhMWnV3z9JTmYaz YoVQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PIWvYKjjSit4chJ+TatQmx3P8eLGBOGqlcUlByEf7Bw=; b=yWiDnJdmev9h1dw4/d0vHJGDExoSuvJcD2zOi7yzL6lmcPSgWrNRAP4CNwMexWj5zh 9BroSuatKl2G/g6cCO2RjFcfwhbvwCyMQRVdeZTu08lotmtxdlPxI0PJevvM134VXbRQ I+EOsV9Yu6K3gr+cyi0DmnTjCTb/9Tbsn/VBRX2cCv7KD3R1xESaIv2iuSVKt4d14Ktb SzEiXo6GRz4LVZmG8Wm15obefw301wtseyKPoF5nD+UrameXyG7r408ri9HfvjU/Gl9u CktiFukUehXJh+gTRh9zI4IFOT335pKzX4kUCFpqlMJacRtLKULhrbXovlC7MC1mlhBv xfvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sc+9X3vQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ym1si2755870ejb.263.2019.10.10.01.46.50; Thu, 10 Oct 2019 01:47:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Sc+9X3vQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388754AbfJJIne (ORCPT + 99 others); Thu, 10 Oct 2019 04:43:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:48326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387662AbfJJIna (ORCPT ); Thu, 10 Oct 2019 04:43:30 -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 A19572054F; Thu, 10 Oct 2019 08:43:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570697010; bh=AFahc8G12K7WvzeCEERC3mW1Z1th2gs47ouNqmHB0wA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sc+9X3vQb//tjUPTuy0icNuktk7jqwRz5RGFEFWM381U7MRdoL8bwIB1qYep9RDic AHx4vjVOAkm4mHd69ruYZJYoyGIVRgXgcz3MsWpSAMuVsEGD4f0+hBPwCFmkWmzM+o EHU7DBZXGr1I4OQzk/xQff3O/emiXNNj7jh5LPRg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrii Nakryiko , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.3 127/148] libbpf: fix false uninitialized variable warning Date: Thu, 10 Oct 2019 10:36:28 +0200 Message-Id: <20191010083619.688232806@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@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: Andrii Nakryiko [ Upstream commit aef70a1f44c0b570e6345c02c2d240471859f0a4 ] Some compilers emit warning for potential uninitialized next_id usage. The code is correct, but control flow is too complicated for some compilers to figure this out. Re-initialize next_id to satisfy compiler. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- tools/lib/bpf/btf_dump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c index 7065bb5b27525..e1357dbb16c24 100644 --- a/tools/lib/bpf/btf_dump.c +++ b/tools/lib/bpf/btf_dump.c @@ -1213,6 +1213,7 @@ static void btf_dump_emit_type_chain(struct btf_dump *d, return; } + next_id = decls->ids[decls->cnt - 1]; next_t = btf__type_by_id(d->btf, next_id); multidim = btf_kind_of(next_t) == BTF_KIND_ARRAY; /* we need space if we have named non-pointer */ -- 2.20.1