Patch "dmaengine: imx-sdma: Handle return value of clk_prepare_enable" has been added to the 4.4-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
dmaengine: imx-sdma: Handle return value of clk_prepare_enable
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
dmaengine-imx-sdma-handle-return-value-of-clk_prepare_enable.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Tue Apr 10 10:31:53 CEST 2018
From: Arvind Yadav <[email protected]>
Date: Wed, 24 May 2017 12:09:53 +0530
Subject: dmaengine: imx-sdma: Handle return value of clk_prepare_enable
From: Arvind Yadav <[email protected]>
[ Upstream commit fb9caf370f4d0457789d13a1a1b110a8db846e5e ]
clk_prepare_enable() can fail here and we must check its return value.
--- drivers/dma/imx-sdma.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/dma/imx-sdma.c +18 -5
@@ -1722,17 +1722,24 @@ static int sdma_probe(struct platform_deif (IS_ERR (sdma->clk_ahb))return PTR_ERR (sdma->clk_ahb); -clk_prepare (sdma->clk_ipg); -clk_prepare (sdma->clk_ahb); + ret =clk_prepare (sdma->clk_ipg); +if (ret) +return ret; + + ret =clk_prepare (sdma->clk_ahb); +if (ret) + goto err_clk; ret =devm_request_irq (&pdev->dev, irq, sdma_int_handler,0 ,"sdma" , sdma);if (ret) -return ret; + goto err_irq; sdma->script_addrs =kzalloc (sizeof (*sdma->script_addrs),GFP_KERNEL ); -if (!sdma->script_addrs) -return -ENOMEM ; +if (!sdma->script_addrs) { + ret = -ENOMEM ; + goto err_irq; + }/* initially no scripts available */ saddr_arr = (s32 *)sdma->script_addrs;
@@ -1847,6 +1854,10 @@ err_register:dma_async_device_unregister (&sdma->dma_device); err_init:kfree (sdma->script_addrs); +err_irq: +clk_unprepare (sdma->clk_ahb); +err_clk: +clk_unprepare (sdma->clk_ipg);return ret; }
@@ -1857,6 +1868,8 @@ static int sdma_remove(struct platform_ddma_async_device_unregister (&sdma->dma_device);kfree (sdma->script_addrs); +clk_unprepare (sdma->clk_ahb); +clk_unprepare (sdma->clk_ipg);/* Kill the tasklet */ for (i =0 ; i <MAX_DMA_CHANNELS ; i++) {struct sdma_channel *sdmac = &sdma->channel[i];
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/dmaengine-imx-sdma-handle-return-value-of-clk_prepare_enable.patch