mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 00:54:09 +08:00
crypto: omap-sham - Only release DMA channel if successfully requested
In omap_sham_probe() and omap_sham_remove(), 'dd->dma_lch' is released without checking to see if it was successfully requested or not. This is a bug and was identified and reported by Dan Carpenter here: http://www.spinics.net/lists/devicetree/msg11023.html Add code to only release 'dd->dma_lch' when its not NULL (that is, when it was successfully requested). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> CC: Joel Fernandes <joelf@ti.com> Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
f4875e12f3
commit
f13ab86a61
@ -1970,6 +1970,7 @@ err_algs:
|
|||||||
crypto_unregister_ahash(
|
crypto_unregister_ahash(
|
||||||
&dd->pdata->algs_info[i].algs_list[j]);
|
&dd->pdata->algs_info[i].algs_list[j]);
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
|
if (dd->dma_lch)
|
||||||
dma_release_channel(dd->dma_lch);
|
dma_release_channel(dd->dma_lch);
|
||||||
data_err:
|
data_err:
|
||||||
dev_err(dev, "initialization failed.\n");
|
dev_err(dev, "initialization failed.\n");
|
||||||
@ -1994,6 +1995,8 @@ static int omap_sham_remove(struct platform_device *pdev)
|
|||||||
&dd->pdata->algs_info[i].algs_list[j]);
|
&dd->pdata->algs_info[i].algs_list[j]);
|
||||||
tasklet_kill(&dd->done_task);
|
tasklet_kill(&dd->done_task);
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
|
if (dd->dma_lch)
|
||||||
dma_release_channel(dd->dma_lch);
|
dma_release_channel(dd->dma_lch);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user