selftests/bpf: Close obj in error path in xdp_adjust_tail
[ Upstream commit 52b49ec1b2c78deb258596c3b231201445ef5380 ] If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj" opened before this should be closed. So use "goto out" to close it instead of using "return" here. Fixes: 110221081aac ("bpf: selftests: update xdp_adjust_tail selftest to include xdp frags") Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Link: https://lore.kernel.org/r/f282a1ed2d0e3fb38cceefec8e81cabb69cab260.1720615848.git.tanggeliang@kylinos.cn Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8262bca056
commit
5b08892910
@ -222,7 +222,7 @@ static void test_xdp_adjust_frags_tail_grow(void)
|
||||
|
||||
prog = bpf_object__next_program(obj, NULL);
|
||||
if (bpf_object__load(obj))
|
||||
return;
|
||||
goto out;
|
||||
|
||||
prog_fd = bpf_program__fd(prog);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user