diff options
author | Quentin Monnet <quentin.monnet@netronome.com> | 2017-11-28 17:44:28 -0800 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2017-11-30 02:09:29 +0100 |
commit | 9b85c2d4508563f4bb1de0d971ed02fea0d0d757 (patch) | |
tree | e9d2683c58114c5b9c78a058d881c117bf1fd75d /kernel/crash_dump.c | |
parent | a39e17b2d842938e19997d2fdc0443fdd4cd8d10 (diff) | |
download | linux-9b85c2d4508563f4bb1de0d971ed02fea0d0d757.tar.bz2 |
tools: bpftool: fix crash on bad parameters with JSON
If bad or unrecognised parameters are specified after JSON output is
requested, `usage()` will try to output null JSON object before the
writer is created.
To prevent this, create the writer as soon as the `--json` option is
parsed.
Fixes: 004b45c0e51a ("tools: bpftool: provide JSON output for all possible commands")
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel/crash_dump.c')
0 files changed, 0 insertions, 0 deletions