]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix handling of optional field_name in btf_dump__emit_type_decl
authorAndrii Nakryiko <andriin@fb.com>
Tue, 3 Mar 2020 18:08:00 +0000 (10:08 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 4 Mar 2020 00:41:36 +0000 (16:41 -0800)
commit5a7bc8b36d30501f136b1b579d56884ff38b53ce
treea8b7de3d5af8f83f95546557c6a888d52396ca94
parentb4353b4f2a299661794c1576822865d5186c6266
libbpf: Fix handling of optional field_name in btf_dump__emit_type_decl

Internal functions, used by btf_dump__emit_type_decl(), assume field_name is
never going to be NULL. Ensure it's always the case.

Fixes: a0edfb813fb0 ("libbpf: Expose BTF-to-C type declaration emitting API")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200303180800.3303471-1-andriin@fb.com
tools/lib/bpf/btf_dump.c