crypto: ccree - rearrange init calls to avoid race
authorGilad Ben-Yossef <gilad@benyossef.com>
Wed, 6 Apr 2022 08:11:38 +0000 (11:11 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Apr 2022 08:34:25 +0000 (16:34 +0800)
commit476c9ab75976c3aea1f7f05e1ebbd1219a0f11bb
tree7d58004ed88424db214da90a2305cc1bebb2bd04
parentc79c09ad31e2c0a5ba0166b284f433b95d9c4c18
crypto: ccree - rearrange init calls to avoid race

Rearrange init calls to avoid the rare race condition of
the cipher algs being registered and used while we still
init the hash code which uses the HW without proper lock.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Reported-by: Dung Nguyen <dung.nguyen.zy@renesas.com>
Tested-by: Jing Dan <jing.dan.nx@renesas.com>
Tested-by: Dung Nguyen <dung.nguyen.zy@renesas.com>
Fixes: 63893811b0fc("crypto: ccree - add ahash support")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_driver.c