Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: btf: avoid -Wreturn-type warning

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@arndb.de>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

authored by

Arnd Bergmann and committed by
Daniel Borkmann
53c8036c a493f5f9

+1 -1
+1 -1
kernel/bpf/btf.c
··· 749 749 !btf_type_is_array(next_type) && 750 750 !btf_type_is_struct(next_type); 751 751 default: 752 - BUG_ON(1); 752 + BUG(); 753 753 } 754 754 } 755 755