Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7eac7144 authored by Fabio Estevam's avatar Fabio Estevam Committed by Herbert Xu
Browse files

crypto: sahara - propagate the error on clk_disable_unprepare() failure



clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 425e0172
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -1578,8 +1578,12 @@ static int sahara_probe(struct platform_device *pdev)

	init_completion(&dev->dma_completion);

	clk_prepare_enable(dev->clk_ipg);
	clk_prepare_enable(dev->clk_ahb);
	err = clk_prepare_enable(dev->clk_ipg);
	if (err)
		goto err_link;
	err = clk_prepare_enable(dev->clk_ahb);
	if (err)
		goto clk_ipg_disable;

	version = sahara_read(dev, SAHARA_REG_VERSION);
	if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx27-sahara")) {
@@ -1619,10 +1623,11 @@ static int sahara_probe(struct platform_device *pdev)
	dma_free_coherent(&pdev->dev,
			  SAHARA_MAX_HW_LINK * sizeof(struct sahara_hw_link),
			  dev->hw_link[0], dev->hw_phys_link[0]);
	clk_disable_unprepare(dev->clk_ipg);
	clk_disable_unprepare(dev->clk_ahb);
	kthread_stop(dev->kthread);
	dev_ptr = NULL;
	clk_disable_unprepare(dev->clk_ahb);
clk_ipg_disable:
	clk_disable_unprepare(dev->clk_ipg);
err_link:
	dma_free_coherent(&pdev->dev,
			  2 * AES_KEYSIZE_128,