Commit a252d5c1 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Greg Kroah-Hartman
Browse files

kunit: debugfs: Fix unchecked dereference in debugfs_print_results()



[ Upstream commit 34dfd5bb ]

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: default avatarRichard Fitzgerald <rf@opensource.cirrus.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Fixes: 38289a26 ("kunit: fix debugfs code to use enum kunit_status, not bool")
Reviewed-by: default avatarRae Moar <rmoar@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f23aa841
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment