diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test_bpf.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c index ed2ebf677457..0c62275630fa 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -5744,7 +5744,14 @@ static int run_one(const struct bpf_prog *fp, struct bpf_test *test) u64 duration; u32 ret; - if (test->test[i].data_size == 0 && + /* + * NOTE: Several sub-tests may be present, in which case + * a zero {data_size, result} tuple indicates the end of + * the sub-test array. The first test is always run, + * even if both data_size and result happen to be zero. + */ + if (i > 0 && + test->test[i].data_size == 0 && test->test[i].result == 0) break; |