Skip to content

Commit 041549b

Browse files
uudiinborkmann
authored andcommitted
tools, bpftool: Fix wrong return value in do_dump()
In case of btf_id does not exist, a negative error code -ENOENT should be returned. Fixes: c93cc69 ("bpftool: add ability to dump BTF types") Signed-off-by: Tianjia Zhang <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Acked-by: John Fastabend <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a278f3d commit 041549b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/bpftool/btf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv)
596596
goto done;
597597
}
598598
if (!btf) {
599-
err = ENOENT;
599+
err = -ENOENT;
600600
p_err("can't find btf with ID (%u)", btf_id);
601601
goto done;
602602
}

0 commit comments

Comments
 (0)