]> git.baikalelectronics.ru Git - kernel.git/commit
[CRYPTO] api: Fix potential race in crypto_remove_spawn
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 17 Nov 2007 14:09:38 +0000 (22:09 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Nov 2007 11:32:09 +0000 (19:32 +0800)
commit0015f296dd097cc6b347842f823f9ed0ebbe303a
treef54bcb1294d2f8dfe87d42cb3603c4dd4ac13d74
parentffef3f16aa3c6ffc5416528ef0baa979bc617f76
[CRYPTO] api: Fix potential race in crypto_remove_spawn

As it is crypto_remove_spawn may try to unregister an instance which is
yet to be registered.  This patch fixes this by checking whether the
instance has been registered before attempting to remove it.

It also removes a bogus cra_destroy check in crypto_register_instance as
1) it's outside the mutex;
2) we have a check in __crypto_register_alg already.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c