File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
tools/testing/selftests/bpf/prog_tests Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -698,7 +698,7 @@ static void test_overflow(bool test_e2big_overflow, bool ret1)
698
698
goto free_link ;
699
699
700
700
buf = malloc (expected_read_len );
701
- if (!buf )
701
+ if (!ASSERT_OK_PTR ( buf , "malloc" ) )
702
702
goto close_iter ;
703
703
704
704
/* do read */
@@ -868,6 +868,8 @@ static void test_bpf_percpu_hash_map(void)
868
868
869
869
skel -> rodata -> num_cpus = bpf_num_possible_cpus ();
870
870
val = malloc (8 * bpf_num_possible_cpus ());
871
+ if (!ASSERT_OK_PTR (val , "malloc" ))
872
+ goto out ;
871
873
872
874
err = bpf_iter_bpf_percpu_hash_map__load (skel );
873
875
if (!ASSERT_OK_PTR (skel , "bpf_iter_bpf_percpu_hash_map__load" ))
@@ -1044,6 +1046,8 @@ static void test_bpf_percpu_array_map(void)
1044
1046
1045
1047
skel -> rodata -> num_cpus = bpf_num_possible_cpus ();
1046
1048
val = malloc (8 * bpf_num_possible_cpus ());
1049
+ if (!ASSERT_OK_PTR (val , "malloc" ))
1050
+ goto out ;
1047
1051
1048
1052
err = bpf_iter_bpf_percpu_array_map__load (skel );
1049
1053
if (!ASSERT_OK_PTR (skel , "bpf_iter_bpf_percpu_array_map__load" ))
You can’t perform that action at this time.
0 commit comments