tools/bpftool: Fix skeleton codegen

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.

Fixes: 2c4779eff837 ("tools, bpftool: Exit on error in function codegen")
Signed-off-by: Andrii Nakryiko <>
Signed-off-by: Alexei Starovoitov <>
Reviewed-by: Tobias Klauser <>
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 7443879..10de76b 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -257,8 +257,6 @@
-	if (n)
-		exit(-1);
 static int do_skeleton(int argc, char **argv)