mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-27 17:35:35 +00:00
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>
This commit is contained in:
parent
ef5d590c9b
commit
7ede5a5ba5
1 changed files with 3 additions and 0 deletions
|
@ -507,6 +507,9 @@ EXPORT_SYMBOL_GPL(crypto_init_spawn2);
|
||||||
|
|
||||||
void crypto_drop_spawn(struct crypto_spawn *spawn)
|
void crypto_drop_spawn(struct crypto_spawn *spawn)
|
||||||
{
|
{
|
||||||
|
if (!spawn->alg)
|
||||||
|
return;
|
||||||
|
|
||||||
down_write(&crypto_alg_sem);
|
down_write(&crypto_alg_sem);
|
||||||
list_del(&spawn->list);
|
list_del(&spawn->list);
|
||||||
up_write(&crypto_alg_sem);
|
up_write(&crypto_alg_sem);
|
||||||
|
|
Loading…
Add table
Reference in a new issue