summaryrefslogtreecommitdiff
path: root/lib/test_bpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r--lib/test_bpf.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 1a0d1e771e6c..69aee608ddec 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -5325,8 +5325,9 @@ static struct bpf_prog *generate_filter(int which, int *err)
return NULL;
}
}
+ /* We don't expect to fail. */
if (*err) {
- pr_cont("FAIL to prog_create err=%d len=%d\n",
+ pr_cont("FAIL to attach err=%d len=%d\n",
*err, fprog.len);
return NULL;
}
@@ -5345,11 +5346,7 @@ static struct bpf_prog *generate_filter(int which, int *err)
fp->type = BPF_PROG_TYPE_SOCKET_FILTER;
memcpy(fp->insnsi, fptr, fp->len * sizeof(struct bpf_insn));
- *err = bpf_prog_select_runtime(fp);
- if (*err) {
- pr_cont("FAIL to select_runtime err=%d\n", *err);
- return NULL;
- }
+ bpf_prog_select_runtime(fp);
break;
}
@@ -5542,8 +5539,8 @@ static __init int test_bpf(void)
pass_cnt++;
continue;
}
- err_cnt++;
- continue;
+
+ return err;
}
pr_cont("jited:%u ", fp->jited);