linux-stable/lib/kunit
Richard Fitzgerald a252d5c1ef 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 14:52:34 -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.filter_glob cmdline option to filter suites 2021-02-08 16:09:27 -07:00
Makefile kunit: test: create a single centralized executor for all tests 2020-10-09 14:37:34 -06:00
assert.c kunit: make KUNIT_EXPECT_STREQ() quote values, don't print literals 2021-04-02 14:14:16 -06:00
debugfs.c kunit: debugfs: Fix unchecked dereference in debugfs_print_results() 2024-01-25 14:52:34 -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: add unit test for filtering suites by names 2021-06-25 11:44:37 -06:00
executor_test.c kunit: fix reference count leak in kfree_at_end 2021-10-01 13:49:38 -06:00
kunit-example-test.c kunit: test: Add example tests which are always skipped 2021-06-25 11:31:03 -06:00
kunit-test.c kunit: Support skipped tests 2021-06-25 11:31:03 -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: generalize kunit_resource API beyond allocated resources 2020-06-26 14:12:00 -06:00
string-stream.h isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
test.c kunit: Don't crash if no parameters are generated 2022-01-27 11:04:40 +01: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-04-08 14:23:12 +02:00