diff mbox series

[bpf] tools/bpftool: fix skeleton codegen

Message ID 20200612201603.680852-1-andriin@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series [bpf] tools/bpftool: fix skeleton codegen | expand

Commit Message

Andrii Nakryiko June 12, 2020, 8:16 p.m. UTC
Remove unnecessary check at the end of codegen() routine which makes codegen()
to always fail and exit bpftool with error code. Positive value of variable
n is not an indicator of a failure.

Cc: Tobias Klauser <tklauser@distanz.ch>
Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
 tools/bpf/bpftool/gen.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Tobias Klauser June 12, 2020, 10:05 p.m. UTC | #1
On 2020-06-12 at 22:16:03 +0200, Andrii Nakryiko <andriin@fb.com> wrote:
> Remove unnecessary check at the end of codegen() routine which makes codegen()
> to always fail and exit bpftool with error code. Positive value of variable
> n is not an indicator of a failure.
> 
> Cc: Tobias Klauser <tklauser@distanz.ch>
> Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
> Signed-off-by: Andrii Nakryiko <andriin@fb.com>

Reviewed-by: Tobias Klauser <tklauser@distanz.ch>

Sorry about this, thanks for fixing it.
Alexei Starovoitov June 12, 2020, 10:26 p.m. UTC | #2
On Fri, Jun 12, 2020 at 3:05 PM Tobias Klauser <tklauser@distanz.ch> wrote:
>
> On 2020-06-12 at 22:16:03 +0200, Andrii Nakryiko <andriin@fb.com> wrote:
> > Remove unnecessary check at the end of codegen() routine which makes codegen()
> > to always fail and exit bpftool with error code. Positive value of variable
> > n is not an indicator of a failure.
> >
> > Cc: Tobias Klauser <tklauser@distanz.ch>
> > Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
>
> Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
>
> Sorry about this, thanks for fixing it.

Applied. Thanks
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 7443879e87af..10de76b296ba 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -257,8 +257,6 @@  static void codegen(const char *template, ...)
 	va_end(args);
 
 	free(s);
-	if (n)
-		exit(-1);
 }
 
 static int do_skeleton(int argc, char **argv)