linux-stable/lib/kunit
Richard Fitzgerald 030a1147ed kunit: debugfs: Fix unchecked dereference in debugfs_print_results()
[ Upstream commit 34dfd5bb2e ]

Move the call to kunit_suite_has_succeeded() after the check that
the kunit_suite pointer is valid.

This was found by smatch:

 lib/kunit/debugfs.c:66 debugfs_print_results() warn: variable
 dereferenced before check 'suite' (see line 63)

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 38289a26e1 ("kunit: fix debugfs code to use enum kunit_status, not bool")
Reviewed-by: Rae Moar <rmoar@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:27:21 -08:00
..
.kunitconfig kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment 2021-04-02 14:14:36 -06:00
Kconfig kunit: add kunit.enable to enable/disable KUnit test 2022-09-30 13:17:39 -06:00
Makefile kunit: split resource API impl from test.c into new resource.c 2022-04-04 16:23:14 -06:00
assert.c kunit: factor out str constants from binary assertion structs 2022-01-31 11:55:39 -07:00
debugfs.c kunit: debugfs: Fix unchecked dereference in debugfs_print_results() 2024-01-25 15:27:21 -08:00
debugfs.h kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display 2020-03-26 14:07:18 -06:00
executor.c kunit: Fix missed memory release in kunit_free_suite_set() 2023-11-20 11:52:02 +01:00
executor_test.c kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites 2022-07-11 17:13:15 -06:00
kunit-example-test.c kunit: add ability to specify suite-level init and exit functions 2022-05-02 12:35:51 -06:00
kunit-test.c kunit: make kunit_kfree() only work on pointers from kunit_malloc() and friends 2022-10-07 10:15:44 -06:00
resource.c kunit: Rework kunit_resource allocation policy 2022-05-12 11:14:39 -06:00
string-stream-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
string-stream.c kunit: alloc_string_stream_fragment error handling bug fix 2023-01-12 12:02:41 +01:00
string-stream.h kunit: drop test pointer in string_stream_fragment 2022-10-07 10:15:33 -06:00
test.c kunit: Fix wild-memory-access bug in kunit_free_suite_set() 2023-09-19 12:28:08 +02:00
try-catch-impl.h kunit: hide unexported try-catch interface in try-catch-impl.h 2020-01-09 16:42:09 -07:00
try-catch.c kunit: make kunit_test_timeout compatible with comment 2022-03-22 15:57:11 -07:00