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

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

parent c71b5ad0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4672,6 +4672,11 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
			break;

		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);
		release_test_data(test, data);