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

libbpf: Ignore hashmap__find() result explicitly in btf_dump

Coverity is reporting that btf_dump_name_dups() doesn't check return
result of hashmap__find() call. This is intentional, so make it explicit
with (void) cast.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221117192824.4093553-1-andrii@kernel.org

authored by

Andrii Nakryiko and committed by
Daniel Borkmann
f80e16b6 97c11d6e

+1 -1
+1 -1
tools/lib/bpf/btf_dump.c
··· 1543 1543 if (!new_name) 1544 1544 return 1; 1545 1545 1546 - hashmap__find(name_map, orig_name, &dup_cnt); 1546 + (void)hashmap__find(name_map, orig_name, &dup_cnt); 1547 1547 dup_cnt++; 1548 1548 1549 1549 err = hashmap__set(name_map, new_name, dup_cnt, &old_name, NULL);