mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
crypto: omap-des - fix crypto engine cleanup
omap_des_probe() allocates and starts a crypto engine, but the remove
path does not call the matching crypto_engine_exit(). The probe failure
path already performs this cleanup.
crypto_engine_alloc_init() creates a kthread worker for processing
requests. Without crypto_engine_exit() during driver removal, the
worker is left running after the device is removed.
Call crypto_engine_exit() after unregistering the algorithms and before
tearing down the remaining request handling resources. This stops the
engine and destroys its worker.
This issue was found by manual code inspection.
Fixes: f1b77aaca8 ("crypto: omap-des - Integrate with the crypto engine framework")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
178829f1b5
commit
5d69ed4cd4
|
|
@ -1082,6 +1082,8 @@ static void omap_des_remove(struct platform_device *pdev)
|
|||
|
||||
omap_des_unregister_algs(dd->pdata);
|
||||
|
||||
crypto_engine_exit(dd->engine);
|
||||
|
||||
cancel_work_sync(&dd->done_task);
|
||||
omap_des_dma_cleanup(dd);
|
||||
pm_runtime_disable(dd->dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user