summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/map_perf_ring.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bpf/bpftool/map_perf_ring.c')
-rw-r--r--tools/bpf/bpftool/map_perf_ring.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/map_perf_ring.c b/tools/bpf/bpftool/map_perf_ring.c
index 1832100d1b27..6d41323be291 100644
--- a/tools/bpf/bpftool/map_perf_ring.c
+++ b/tools/bpf/bpftool/map_perf_ring.c
@@ -194,8 +194,10 @@ int do_event_pipe(int argc, char **argv)
}
while (argc) {
- if (argc < 2)
+ if (argc < 2) {
BAD_ARG();
+ goto err_close_map;
+ }
if (is_prefix(*argv, "cpu")) {
char *endptr;
@@ -221,6 +223,7 @@ int do_event_pipe(int argc, char **argv)
NEXT_ARG();
} else {
BAD_ARG();
+ goto err_close_map;
}
do_all = false;
OpenPOWER on IntegriCloud