diff --git a/crypto/algapi.c b/crypto/algapi.c index c0755cf4f53f8b5eb518cd96d77a70fc3f837367..33eb6e73eff1c4c1cd4cb9b3709407a043711fa4 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -599,6 +599,9 @@ int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, { int err = -EAGAIN; + if (WARN_ON_ONCE(inst == NULL)) + return -EINVAL; + spawn->inst = inst; spawn->mask = mask;