Thread (9 messages) flat view 9 messages, 3 authors, 2015-08-07
STALE4020d REVIEWED: 8 (7M)

Revision v2 of 2 in this series; 2 review trailers (1 from subsystem maintainers).

Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH V2 net-next 1/6] test_bpf: avoid oopsing the kernel when generate_test_data() fails.

From: Nicolas Schichan <hidden>
Date: 2015-08-04 13:20:04
Also in: lkml
Subsystem: bpf [general] (safe dynamic programs and tools), library code, the rest · Maintainers: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi, Andrew Morton, Linus Torvalds

Signed-off-by: Nicolas Schichan <redacted>
Acked-by: Alexei Starovoitov <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>

---
 lib/test_bpf.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 3afddf2..6843d0b 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -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);
 
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help