Skip to content
Snippets Groups Projects
Commit 7ede5a5b authored by Herbert Xu's avatar Herbert Xu
Browse files

crypto: api - Fix crypto_drop_spawn crash on blank spawns


This patch allows crypto_drop_spawn to be called on spawns that
have not been initialised or have failed initialisation.  This
fixes potential crashes during initialisation without adding
special case code.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ef5d590c
No related branches found
No related tags found
No related merge requests found
......@@ -507,6 +507,9 @@ EXPORT_SYMBOL_GPL(crypto_init_spawn2);
void crypto_drop_spawn(struct crypto_spawn *spawn)
{
if (!spawn->alg)
return;
down_write(&crypto_alg_sem);
list_del(&spawn->list);
up_write(&crypto_alg_sem);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment