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
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-example-test.c
kunit-test.c
string-stream-test.c
string-stream.c
string-stream.h
test.c
try-catch-impl.h
try-catch.c