]> git.baikalelectronics.ru Git - kernel.git/commit
tools, bpftool: Exit on error in function codegen
authorTobias Klauser <tklauser@distanz.ch>
Thu, 11 Jun 2020 10:33:41 +0000 (12:33 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 11 Jun 2020 21:52:19 +0000 (23:52 +0200)
commit7a105cad991e64d3e71f3cf9d734f2a0e5e75c84
tree590ed0b5cc99e94266f3b68b14681223f85362dd
parente8cdb827823c48112ec5cee3050ab2ba01c7aca7
tools, bpftool: Exit on error in function codegen

Currently, the codegen function might fail and return an error. But its
callers continue without checking its return value. Since codegen can
fail only in the unlikely case of the system running out of memory or
the static template being malformed, just exit(-1) directly from codegen
and make it void-returning.

Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200611103341.21532-1-tklauser@distanz.ch
tools/bpf/bpftool/gen.c