diff --git a/crypto/algboss.c b/crypto/algboss.c index 5e6df2a087fa..8e1cfeb33d2d 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c @@ -207,6 +207,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval) return NOTIFY_OK; } +#ifndef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS static int cryptomgr_test(void *data) { struct crypto_test_param *param = data; @@ -228,10 +229,13 @@ static int cryptomgr_test(void *data) kfree(param); module_put_and_exit(0); } +#endif /* CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */ static int cryptomgr_schedule_test(struct crypto_alg *alg) { +#ifndef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS struct task_struct *thread; +#endif struct crypto_test_param *param; u32 type; @@ -252,14 +256,23 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg) param->type = type; +#ifndef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS thread = kthread_run(cryptomgr_test, param, "cryptomgr_test"); if (IS_ERR(thread)) goto err_free_param; +#else + crypto_alg_tested(param->driver, 0); + + kfree(param); + module_put(THIS_MODULE); +#endif return NOTIFY_STOP; +#ifndef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS err_free_param: kfree(param); +#endif err_put_module: module_put(THIS_MODULE); err: