Skip to content

Commit ca16b42

Browse files
Zhihao Chenganakryiko
authored andcommitted
tools/bpftool: Fix error return code in do_batch()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 668da74 ("tools: bpftool: add support for quotations ...") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20210609115916.2186872-1-chengzhihao1@huawei.com
1 parent 3b3af91 commit ca16b42

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tools/bpf/bpftool/main.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ static int do_batch(int argc, char **argv)
341341
n_argc = make_args(buf, n_argv, BATCH_ARG_NB_MAX, lines);
342342
if (!n_argc)
343343
continue;
344-
if (n_argc < 0)
344+
if (n_argc < 0) {
345+
err = n_argc;
345346
goto err_close;
347+
}
346348

347349
if (json_output) {
348350
jsonw_start_object(json_wtr);

0 commit comments

Comments
 (0)