[PATCH] selftests/media_tests: fix a resource leak

2023-11-20 Thread zhujun2
The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/media_tests/media_device_open.c | 3 +++ tools/testing/selftests/media_tests/media_device_test.c | 3 +++ 2 files

[PATCH] selftests/memfd: fix a memleak

2023-11-20 Thread zhujun2
The memory allocated within a function should be released before the function return,otherwise memleak will occur. Signed-off-by: zhujun2 --- tools/testing/selftests/memfd/fuse_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing

[PATCH] selftests/memfd: fix a memleak

2023-11-14 Thread zhujun2
The memory allocated within a function should be released before the function return,otherwise memleak will occur. Signed-off-by: zhujun2 --- tools/testing/selftests/memfd/fuse_test.c | 3 +++ tools/testing/selftests/memfd/memfd_test.c | 10 ++ 2 files changed, 13 insertions(+) diff

[PATCH] selftests/media_tests: fix a resource leak

2023-11-14 Thread zhujun2
The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/media_tests/media_device_open.c | 3 +++ tools/testing/selftests/media_tests/media_device_test.c | 3 +++ 2 files

[PATCH] selftests:modify the incorrect print format

2023-10-18 Thread zhujun2
when the argument type is 'unsigned int',printf '%u' in format string that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/too

[PATCH] selftests/efivarfs: create-read: fix a resource leak

2023-10-17 Thread zhujun2
The opened file should be closed in main(), otherwise resource leak will occur that this problem was discovered by code reading Signed-off-by: zhujun2 --- tools/testing/selftests/efivarfs/create-read.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/efivarfs/create

[PATCH] selftests/efivarfs: create-read: fix a resource leak

2023-10-16 Thread zhujun2
The opened file should be closed in main(), otherwise resource leak will occur Signed-off-by: zhujun2 --- tools/testing/selftests/efivarfs/create-read.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/efivarfs/create-read.c b/tools/testing/selftests/efivarfs

[PATCH] selftests:modify the incorrect print format

2023-10-16 Thread zhujun2
when the argument type is 'unsigned int',printf '%u' in format string Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/s

[PATCH] selftests: net: remove unused variables

2023-10-15 Thread zhujun2
These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 --- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/test_unix_oob.c | 2 -- tools/testing/selftests/net/nettest.c | 5 +++-- 3 files changed, 3

[PATCH] selftests:modify the incorrect print format

2023-10-15 Thread zhujun2
printf %d in format string requires 'int' but the argument type is 'unsigned int' Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/too

[PATCH] selftests: bpf: remove unused variables

2023-10-12 Thread zhujun2
These variables are never referenced in the code, just remove them. Signed-off-by: zhujun2 --- tools/testing/selftests/bpf/prog_tests/atomic_bounds.c | 1 - tools/testing/selftests/bpf/prog_tests/kfree_skb.c | 2 -- tools/testing/selftests/bpf/prog_tests/perf_branches.c | 6

[PATCH] selftests: bpf: remove unused variables

2023-10-10 Thread zhujun2
These variables are never referenced in the code, just remove them. Signed-off-by: zhujun2 --- tools/testing/selftests/bpf/prog_tests/atomic_bounds.c | 1 - tools/testing/selftests/bpf/prog_tests/kfree_skb.c | 2 -- tools/testing/selftests/bpf/prog_tests/perf_branches.c | 6