diff options
| author | Alan Maguire <[email protected]> | 2021-07-20 09:49:53 +0100 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2021-07-20 13:49:25 -0700 |
| commit | 720c29fca9fb87c473148ff666b75314420cdda6 (patch) | |
| tree | f4b361833faca06c98dad5083ee32277498c23a6 /tools/lib | |
| parent | a17553dde294289c5f45dd79b6cfd532df610b5f (diff) | |
libbpf: Propagate errors when retrieving enum value for typed data display
When retrieving the enum value associated with typed data during
"is data zero?" checking in btf_dump_type_data_check_zero(), the
return value of btf_dump_get_enum_value() is not passed to the caller
if the function returns a non-zero (error) value. Currently, 0
is returned if the function returns an error. We should instead
propagate the error to the caller.
Signed-off-by: Alan Maguire <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib')
| -rw-r--r-- | tools/lib/bpf/btf_dump.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c index d52e546a515c..e4b483f15fb9 100644 --- a/tools/lib/bpf/btf_dump.c +++ b/tools/lib/bpf/btf_dump.c @@ -2166,8 +2166,9 @@ static int btf_dump_type_data_check_zero(struct btf_dump *d, return -ENODATA; } case BTF_KIND_ENUM: - if (btf_dump_get_enum_value(d, t, data, id, &value)) - return 0; + err = btf_dump_get_enum_value(d, t, data, id, &value); + if (err) + return err; if (value == 0) return -ENODATA; return 0; |
