Re: [PATCH, net-next 1/2] bpf: btf: avoid -Wreturn-type warning

From: Daniel Borkmann
Date: Sun May 27 2018 - 18:37:00 EST


On 05/25/2018 11:33 PM, Arnd Bergmann wrote:
> gcc warns about a noreturn function possibly returning in
> some configurations:
>
> kernel/bpf/btf.c: In function 'env_type_is_resolve_sink':
> kernel/bpf/btf.c:729:1: error: control reaches end of non-void function [-Werror=return-type]
>
> Using BUG() instead of BUG_ON() avoids that warning and otherwise
> does the exact same thing.
>
> Fixes: eb3f595dab40 ("bpf: btf: Validate type reference")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Applied to bpf-next, thanks Arnd!