diff --git a/crypto/fips140-module.c b/crypto/fips140-module.c index 8d8e723816d9..a0e199b9e8a1 100644 --- a/crypto/fips140-module.c +++ b/crypto/fips140-module.c @@ -539,8 +539,17 @@ fips140_init(void) initcall < &__initcall_end_marker; initcall++) { int (*init)(void) = offset_to_ptr(initcall); + int err = init(); - init(); + /* + * ENODEV is expected from initcalls that only register + * algorithms that depend on non-present CPU features. Besides + * that, errors aren't expected here. + */ + if (err && err != -ENODEV) { + pr_err("initcall %ps() failed: %d\n", init, err); + goto panic; + } } if (!update_live_fips140_algos())