selftests/bpf: Fix result check for test_bpf_hash_map
authorDmitrii Dolgov <9erthalion6@gmail.com>
Tue, 10 May 2022 15:52:31 +0000 (17:52 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 10 May 2022 18:20:45 +0000 (11:20 -0700)
The original condition looks like a typo, verify the skeleton loading
result instead.

Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Link: https://lore.kernel.org/r/20220510155233.9815-3-9erthalion6@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter.c

index 2c403ddc8076c005cd5d767724e378e385d1c27d..6943209b7457b6b730f57d83e2b651b46b87603a 100644 (file)
@@ -629,8 +629,7 @@ static void test_bpf_hash_map(void)
        skel->bss->in_test_mode = true;
 
        err = bpf_iter_bpf_hash_map__load(skel);
-       if (CHECK(!skel, "bpf_iter_bpf_hash_map__load",
-                 "skeleton load failed\n"))
+       if (!ASSERT_OK(err, "bpf_iter_bpf_hash_map__load"))
                goto out;
 
        /* iterator with hashmap2 and hashmap3 should fail */