Quentin says: First commit in this series fixes a crash that occurs when incorrect arguments are passed to bpftool after the `--json` option. It comes from the usage() function trying to use the JSON writer, although the latter has not been created yet at that point.
Other patches add destruction of the writer in case the program exits in usage(), fix error messages handling when an unrecognized option is encountered, remove a spurious new-line character in an error message. Last patches are related to the Makefiles. They fix the installation directory prefix and .PHONY targets. Quentin Monnet (6): tools: bpftool: fix crash on bad parameters with JSON tools: bpftool: clean up the JSON writer before exiting in usage() tools: bpftool: make error message from getopt_long() JSON-friendly tools: bpftool: remove spurious line break from error message tools: bpftool: change installation directory tools: bpftool: declare phony targets as such tools/bpf/bpftool/Documentation/Makefile | 2 +- tools/bpf/bpftool/Makefile | 7 ++++--- tools/bpf/bpftool/main.c | 36 +++++++++++++++++++++----------- tools/bpf/bpftool/main.h | 5 +++-- 4 files changed, 32 insertions(+), 18 deletions(-) -- 2.14.1