]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: maps: close json array on error paths of show
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 22 Dec 2017 19:36:05 +0000 (11:36 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 23 Dec 2017 00:09:52 +0000 (01:09 +0100)
commitc951d7c8da630d0fc8ddc32d138a132b0137d74a
tree1d92de9cfddf5c02a872b48e5bbc5d9e08d54f8d
parent8a8a7e309b44c748c348bc3dcd74f575a8b476b9
tools: bpftool: maps: close json array on error paths of show

We can't return from the middle of do_show(), because
json_array will not be closed.  Break out of the loop.
Note that the error handling after the loop depends on
errno, so no need to set err.

Fixes: 00d00196d6b4 ("tools: bpftool: add JSON output for `bpftool map *` commands")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/map.c