Re: [PATCH] selftests/bpf:fix a resource leak in main()

2024-07-12 Thread Stanislav Fomichev
On 07/12, Markus Elfring wrote: > > The requested resources should be closed before return in main(), otherwise > > resource leak will occur. Add a check of cg_fd before close(). > > > > Fixes: 435f90a338ae ("selftests/bpf: add a test case for sock_ops > > perf-event notification") > > Signed-off-

Re: [PATCH] selftests/bpf:fix a resource leak in main()

2024-07-12 Thread Markus Elfring
> The requested resources should be closed before return in main(), otherwise > resource leak will occur. Add a check of cg_fd before close(). > > Fixes: 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event > notification") > Signed-off-by: Ma Ke Please reconsider such informati

Re: [PATCH] selftests/bpf:fix a resource leak in main()

2024-07-11 Thread Stanislav Fomichev
On 07/11, Ma Ke wrote: > The requested resources should be closed before return in main(), otherwise > resource leak will occur. Add a check of cg_fd before close(). > > Fixes: 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event > notification") > Signed-off-by: Ma Ke > --- >

[PATCH] selftests/bpf:fix a resource leak in main()

2024-07-11 Thread Ma Ke
The requested resources should be closed before return in main(), otherwise resource leak will occur. Add a check of cgfd before close(). Fixes: 5ecd8c22739b ("selftests/bpf: Selftest for bpf_skb_ancestor_cgroup_id") Signed-off-by: Ma Ke --- tools/testing/selftests/bpf/test_skb_cgroup_id_user.c

[PATCH] selftests/bpf:fix a resource leak in run_tests()

2024-07-11 Thread Ma Ke
The requested resources should be closed before return in run_tests(), otherwise resource leak will occur. Add a check of cg_fd before close(). Fixes: 1d436885b23b ("selftests/bpf: Selftest for sys_bind post-hooks.") Signed-off-by: Ma Ke --- tools/testing/selftests/bpf/test_sock.c | 3 ++- 1 fil

[PATCH] selftests/bpf:fix a resource leak in main()

2024-07-11 Thread Ma Ke
The requested resources should be closed before return in main(), otherwise resource leak will occur. Add a check of cg_fd before close(). Fixes: 1f5fa9ab6e2e ("selftests/bpf: Test BPF_CGROUP_SYSCTL") Signed-off-by: Ma Ke --- tools/testing/selftests/bpf/test_sysctl.c | 3 ++- 1 file changed, 2 i

[PATCH] selftests/bpf:fix a resource leak in main()

2024-07-11 Thread Ma Ke
The requested resources should be closed before return in main(), otherwise resource leak will occur. Add a check of cg_fd before close(). Fixes: 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event notification") Signed-off-by: Ma Ke --- tools/testing/selftests/bpf/test_tcpno

Re: [PATCH] selftests/bpf:fix a resource leak

2024-07-09 Thread Jiri Olsa
On Tue, Jul 09, 2024 at 02:38:42AM -0700, Zhu Jun wrote: > The requested resources should be closed before return > in main(), otherwise resource leak will occur > > Signed-off-by: Zhu Jun should have 'PATCHv2 bpf-next' (or bpf) in subject, other than that lgtm Acked-by: Jiri Olsa jirka > --

[PATCH] selftests/bpf:fix a resource leak

2024-07-09 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- v1 -> v2: check for cg_fd >= 0 and have just one out label tools/testing/selftests/bpf/test_sockmap.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-)

Re: [PATCH] selftests/bpf:fix a resource leak

2024-07-01 Thread Jiri Olsa
On Sun, Jun 30, 2024 at 07:13:31PM -0700, Zhu Jun wrote: > The requested resources should be closed before return > in main(), otherwise resource leak will occur > > Signed-off-by: Zhu Jun could you please send this not as reply but as a separate patch with v2 > --- > tools/testing/selftests/b

[PATCH] selftests/bpf:fix a resource leak

2024-06-30 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.

Re: [PATCH] selftests/bpf:fix a resource leak

2024-06-28 Thread Daniel Borkmann
On 6/27/24 8:01 AM, Zhu Jun wrote: The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/self

[PATCH] selftests/bpf:fix a resource leak

2024-06-26 Thread Zhu Jun
The requested resources should be closed before return in main(), otherwise resource leak will occur Signed-off-by: Zhu Jun --- tools/testing/selftests/bpf/test_sockmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testi