Skip to content

Commit

Permalink
crypto: api - Fix crypto_drop_spawn crash on blank spawns
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Jul 9, 2009
1 parent ef5d590 commit 7ede5a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7ede5a5

Please sign in to comment.