[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191105165914.GD952516@vkoul-mobl>
Date: Tue, 5 Nov 2019 22:29:14 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Satendra Singh Thakur <sst2005@...il.com>
Cc: Sean Wang <sean.wang@...iatek.com>,
Dan Williams <dan.j.williams@...el.com>,
Matthias Brugger <matthias.bgg@...il.com>,
dmaengine@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma/mediatek-hs/probe: Fixed a memory leak when
devm_request_irq fails
On 24-10-19, 10:13, Satendra Singh Thakur wrote:
> When devm_request_irq fails, currently, the function
> dma_async_device_unregister gets called. This doesn't free
> the resources allocated by of_dma_controller_register.
> Therefore, we have called of_dma_controller_free for this purpose.
Please revise this one as well!
>
> Signed-off-by: Satendra Singh Thakur <sst2005@...il.com>
> ---
> drivers/dma/mediatek/mtk-hsdma.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 1a2028e1c29e..4c58da742143 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -997,7 +997,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
> if (err) {
> dev_err(&pdev->dev,
> "request_irq failed with err %d\n", err);
> - goto err_unregister;
> + goto err_free;
> }
>
> platform_set_drvdata(pdev, hsdma);
> @@ -1006,6 +1006,8 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
>
> return 0;
>
> +err_free:
> + of_dma_controller_free(pdev->dev.of_node);
> err_unregister:
> dma_async_device_unregister(dd);
>
> --
> 2.17.1
--
~Vinod
Powered by blists - more mailing lists