libbpf: ignore hashmap__find() result explicitly in btf_dump
Andrii Nakryiko
maintainerPATCH 1/1 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 <[email protected]>
--- tools/lib/bpf/btf_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/btf_dump.c +1 -1
@@ -1543,7 +1543,7 @@ static size_t btf_dump_name_dups(struct btf_dump *d, struct hashmap *name_map,if (!new_name)return 1 ; -hashmap__find (name_map, orig_name, &dup_cnt); + (void )hashmap__find (name_map, orig_name, &dup_cnt); dup_cnt++; err =hashmap__set (name_map, new_name, dup_cnt, &old_name,NULL );
Signature · 1 line
2.30.2
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Quoted 8 lines · On Thu, 17 Nov 2022 11:28:24 -0800 you wrote:
Coverity is reporting that
btf_dump_name_dups()doesn't check return result ofhashmap__find()call. This is intentional, so make it explicit with (void) cast.Signed-off-by Andrii Nakryiko <[email protected]>--- tools/lib/bpf/btf_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [bpf-next] libbpf: ignore hashmap__find() result explicitly in btf_dump
https://git.kernel.org/bpf/bpf-next/c/f80e16b614f3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html