]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: picoxcell - Fix potential race condition bug
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Tue, 11 Aug 2020 12:30:24 +0000 (18:00 +0530)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Aug 2020 04:47:50 +0000 (14:47 +1000)
commit91297ea1b0cbaa0cbb0851bc78b65b93cf8453b6
tree03db6834bad7fda6911c38bcda706e8aafb91b76
parent889a83e2bb3fd7a47b11169f1a3a051778730e23
crypto: picoxcell - Fix potential race condition bug

engine->stat_irq_thresh was initialized after device_create_file() in
the probe function, the initialization may race with call to
spacc_stat_irq_thresh_store() which updates engine->stat_irq_thresh,
therefore initialize it before creating the file in probe function.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 60c6bc1e4e34 ("crypto: picoxcell - add support for the...")
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/picoxcell_crypto.c