libbpf: Fix signedness bug in btf_dump_array_data()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 8 Feb 2022 07:15:52 +0000 (10:15 +0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 8 Feb 2022 21:34:44 +0000 (22:34 +0100)
commit4172843ed4a38f97084032f74f07b2037b5da3a6
tree75d656643c3c8ae7f4918843ae3c902aab6b9ce1
parent5912fcb4bee1ab7a956ffe81b8ab30a8667ac034
libbpf: Fix signedness bug in btf_dump_array_data()

The btf__resolve_size() function returns negative error codes so
"elem_size" must be signed for the error handling to work.

Fixes: 920d16af9b42 ("libbpf: BTF dumper support for typed data")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220208071552.GB10495@kili
tools/lib/bpf/btf_dump.c