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: c93cc69004 ("bpftool: add ability to dump BTF types")
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200802111540.5384-1-tianjia.zhang@linux.alibaba.com
This commit is contained in:
Tianjia Zhang 2020-08-02 19:15:40 +08:00 коммит произвёл Daniel Borkmann
Родитель a278f3d819
Коммит 041549b7b2
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -596,7 +596,7 @@ static int do_dump(int argc, char **argv)
goto done;
}
if (!btf) {
err = ENOENT;
err = -ENOENT;
p_err("can't find btf with ID (%u)", btf_id);
goto done;
}