]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
selftests/bpf, flow_dissector: Close TAP device FD after the test
authorJakub Sitnicki <jakub@cloudflare.com>
Sun, 31 May 2020 08:28:44 +0000 (10:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:53 +0000 (09:32 +0200)
[ Upstream commit b8215dce7dfd817ca38807f55165bf502146cd68 ]

test_flow_dissector leaves a TAP device after it's finished, potentially
interfering with other tests that will run after it. Fix it by closing the
TAP descriptor on cleanup.

Fixes: 0905beec9f52 ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-11-jakub@cloudflare.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/prog_tests/flow_dissector.c

index 92563898867cb690e8d8193756603f4a8683ee81..9f3634c9971d04de9f6671ab14738ae4685ab435 100644 (file)
@@ -523,6 +523,7 @@ void test_flow_dissector(void)
                CHECK_ATTR(err, tests[i].name, "bpf_map_delete_elem %d\n", err);
        }
 
+       close(tap_fd);
        bpf_prog_detach(prog_fd, BPF_FLOW_DISSECTOR);
        bpf_object__close(obj);
 }