diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-09-22 17:42:27 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-08 00:21:48 (GMT) |
commit | 1b31464c8843febdeca414868bd935b13bba9fd1 (patch) | |
tree | 055a7eac943550465acf0bb7126e3b2879edb6f3 /drivers | |
parent | aea6167a4ddf9b35f0bf5193257fdbb39b7070d7 (diff) | |
download | linux-fsl-qoriq-1b31464c8843febdeca414868bd935b13bba9fd1.tar.xz |
crypto: dcp - Fix the path for releasing the resources
tasklet_kill() is not being called in probe and the remove function releases
the resources in the wrong order.
Fix these issues.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 48e6dc1b2a1ad8186d48968d5018912bdacac744)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/dcp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/crypto/dcp.c b/drivers/crypto/dcp.c index 93ab753..7b77c84 100644 --- a/drivers/crypto/dcp.c +++ b/drivers/crypto/dcp.c @@ -842,6 +842,8 @@ err_unregister: for (j = 0; j < i; j++) crypto_unregister_alg(&algs[j]); err_free_key_iv: + tasklet_kill(&dev->done_task); + tasklet_kill(&dev->queue_task); dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, dev->payload_base_dma); err_free_hw_packet: @@ -858,20 +860,20 @@ static int dcp_remove(struct platform_device *pdev) int j; dev = platform_get_drvdata(pdev); - dma_free_coherent(&pdev->dev, - DCP_MAX_PKG * sizeof(struct dcp_hw_packet), - dev->hw_pkg[0], dev->hw_phys_pkg); + misc_deregister(&dev->dcp_bootstream_misc); - dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, - dev->payload_base_dma); + for (j = 0; j < ARRAY_SIZE(algs); j++) + crypto_unregister_alg(&algs[j]); tasklet_kill(&dev->done_task); tasklet_kill(&dev->queue_task); - for (j = 0; j < ARRAY_SIZE(algs); j++) - crypto_unregister_alg(&algs[j]); + dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, + dev->payload_base_dma); - misc_deregister(&dev->dcp_bootstream_misc); + dma_free_coherent(&pdev->dev, + DCP_MAX_PKG * sizeof(struct dcp_hw_packet), + dev->hw_pkg[0], dev->hw_phys_pkg); return 0; } |