Commit e34684f8 authored by Nicolas Schichan's avatar Nicolas Schichan Committed by David S. Miller

test_bpf: avoid oopsing the kernel when generate_test_data() fails.

Signed-off-by: default avatarNicolas Schichan <nschichan@freebox.fr>
Acked-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c71b5ad0
...@@ -4672,6 +4672,11 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test) ...@@ -4672,6 +4672,11 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
break; break;
data = generate_test_data(test, i); data = generate_test_data(test, i);
if (!data && !(test->aux & FLAG_NO_DATA)) {
pr_cont("data generation failed ");
err_cnt++;
break;
}
ret = __run_one(fp, data, runs, &duration); ret = __run_one(fp, data, runs, &duration);
release_test_data(test, data); release_test_data(test, data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment