aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2009-07-08 23:34:06 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-07-08 23:34:06 -0400
commit7ede5a5ba55a696a6e1d8456526e44635e966a81 (patch)
tree95e934009410a0080fb8f41ee4eb6f203978fb1d /crypto/algapi.c
parentef5d590c9b9a00b017683006fe4cf959b9532336 (diff)
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: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 2154815201a7..6a98076d9d2a 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -507,6 +507,9 @@ EXPORT_SYMBOL_GPL(crypto_init_spawn2);
507 507
508void crypto_drop_spawn(struct crypto_spawn *spawn) 508void crypto_drop_spawn(struct crypto_spawn *spawn)
509{ 509{
510 if (!spawn->alg)
511 return;
512
510 down_write(&crypto_alg_sem); 513 down_write(&crypto_alg_sem);
511 list_del(&spawn->list); 514 list_del(&spawn->list);
512 up_write(&crypto_alg_sem); 515 up_write(&crypto_alg_sem);