crypto: api - Call crypto_schedule_test outside of mutex
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Nov 2024 01:56:28 +0000 (09:56 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 10 Dec 2024 05:44:20 +0000 (13:44 +0800)
commitb7685262884c9aaedd622fab974c0820b62eb608
treeed9bb1558a3771267e02a91c01bef9e184ed2d27
parent8dd458cbc5be9ce4427ffce7a9dcdbff4dfc4ac9
crypto: api - Call crypto_schedule_test outside of mutex

There is no need to hold the crypto mutex when scheduling a self-
test.  In fact prior to the patch introducing asynchronous testing,
this was done outside of the locked area.

Move the crypto_schedule_test call back out of the locked area.

Also move crypto_remove_final to the else branch under the schedule-
test call as the list of algorithms to be removed is non-empty only
when the test larval is NULL (i.e., testing is disabled).

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