Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2e72a0b authored by Daniel Borkmann's avatar Daniel Borkmann
Browse files

Merge branch 'bpf-bpftool-fixes'



Jakub Kicinski says:

====================
Two small fixes for error handling in bpftool prog load, first patch
removes a duplicated message, second one frees resources correctly.
Multiple error messages break JSON:

{
    "error": "can't pin the object (/sys/fs/bpf/a): File exists"
},{
    "error": "failed to pin program"
}
====================

Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parents 3739a21e bfee71fb
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -694,15 +694,19 @@ static int do_load(int argc, char **argv)
		return -1;
	}

	if (do_pin_fd(prog_fd, argv[1])) {
		p_err("failed to pin program");
		return -1;
	}
	if (do_pin_fd(prog_fd, argv[1]))
		goto err_close_obj;

	if (json_output)
		jsonw_null(json_wtr);

	bpf_object__close(obj);

	return 0;

err_close_obj:
	bpf_object__close(obj);
	return -1;
}

static int do_help(int argc, char **argv)