From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH, net-next 2/2] bpf: avoid -Wmaybe-uninitialized warning Date: Mon, 28 May 2018 00:37:03 +0200 Message-ID: <61a96e95-a256-ef40-c25d-e7dbf4c51b02@iogearbox.net> References: <20180525213331.2115471-1-arnd@arndb.de> <20180525213331.2115471-2-arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Yonghong Song , "David S. Miller" , Song Liu , Martin KaFai Lau , Chenbo Feng , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Arnd Bergmann , Alexei Starovoitov Return-path: In-Reply-To: <20180525213331.2115471-2-arnd@arndb.de> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 05/25/2018 11:33 PM, Arnd Bergmann wrote: > The stack_map_get_build_id_offset() function is too long for gcc to track > whether 'work' may or may not be initialized at the end of it, leading > to a false-positive warning: > > kernel/bpf/stackmap.c: In function 'stack_map_get_build_id_offset': > kernel/bpf/stackmap.c:334:13: error: 'work' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > This removes the 'in_nmi_ctx' flag and uses the state of that variable > itself to see if it got initialized. > > Fixes: bae77c5eb5b2 ("bpf: enable stackmap with build_id in nmi context") > Signed-off-by: Arnd Bergmann Applied to bpf-next, thanks Arnd!