WSL2-Linux-Kernel/lib/kunit
Richard Fitzgerald a252d5c1ef kunit: debugfs: Fix unchecked dereference in debugfs_print_results()
[ Upstream commit 34dfd5bb2e5507e69d9b6d6c90f546600c7a4977 ]

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
Kconfig
Makefile
assert.c
debugfs.c kunit: debugfs: Fix unchecked dereference in debugfs_print_results() 2024-01-25 14:52:34 -08:00
debugfs.h
executor.c
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.c
string-stream-test.c
string-stream.c
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
try-catch.c kunit: make kunit_test_timeout compatible with comment 2022-04-08 14:23:12 +02:00