Skip to content
Commit 5496b9b7 authored by Scott Mayhew's avatar Scott Mayhew Committed by Shuah Khan
Browse files

kunit: bail out early in __kunit_test_suites_init() if there are no suites to test



Commit c72a8709 added a mutex to prevent kunit tests from running
concurrently.  Unfortunately that mutex gets locked during module load
regardless of whether the module actually has any kunit tests.  This
causes a problem for kunit tests that might need to load other kernel
modules (e.g. gss_krb5_test loading the camellia module).

So check to see if there are actually any tests to run before locking
the kunit_run_lock mutex.

Fixes: c72a8709 ("kunit: add ability to run tests after boot using debugfs")
Reported-by: default avatarNico Pache <npache@redhat.com>
Signed-off-by: default avatarScott Mayhew <smayhew@redhat.com>
Reviewed-by: default avatarRae Moar <rmoar@google.com>
Reviewed-by: default avatarDavid Gow <davidgow@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent a96a3945
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment