Commit 48e6dc1b authored by Fabio Estevam's avatar Fabio Estevam Committed by Herbert Xu

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: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0ff64755
...@@ -842,6 +842,8 @@ static int dcp_probe(struct platform_device *pdev) ...@@ -842,6 +842,8 @@ static int dcp_probe(struct platform_device *pdev)
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
crypto_unregister_alg(&algs[j]); crypto_unregister_alg(&algs[j]);
err_free_key_iv: 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, dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base,
dev->payload_base_dma); dev->payload_base_dma);
err_free_hw_packet: err_free_hw_packet:
...@@ -858,20 +860,20 @@ static int dcp_remove(struct platform_device *pdev) ...@@ -858,20 +860,20 @@ static int dcp_remove(struct platform_device *pdev)
int j; int j;
dev = platform_get_drvdata(pdev); dev = platform_get_drvdata(pdev);
dma_free_coherent(&pdev->dev, misc_deregister(&dev->dcp_bootstream_misc);
DCP_MAX_PKG * sizeof(struct dcp_hw_packet),
dev->hw_pkg[0], dev->hw_phys_pkg);
dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base, for (j = 0; j < ARRAY_SIZE(algs); j++)
dev->payload_base_dma); crypto_unregister_alg(&algs[j]);
tasklet_kill(&dev->done_task); tasklet_kill(&dev->done_task);
tasklet_kill(&dev->queue_task); tasklet_kill(&dev->queue_task);
for (j = 0; j < ARRAY_SIZE(algs); j++) dma_free_coherent(&pdev->dev, 2 * AES_KEYSIZE_128, dev->payload_base,
crypto_unregister_alg(&algs[j]); 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment