* [PATCH 2/2] dmaengine: ti: edma: fix missed failure handling
@ 2019-11-18 7:38 Chuhong Yuan
2019-11-22 5:43 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-11-18 7:38 UTC (permalink / raw)
Cc: Vinod Koul, Dan Williams, dmaengine, linux-kernel, Chuhong Yuan
When devm_kcalloc fails, it forgets to call edma_free_slot.
Replace direct return with failure handler to fix it.
Fixes: 1be5336bc7ba ("dmaengine: edma: New device tree binding")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
drivers/dma/ti/edma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index 8be32fd9f762..79bc8503cf32 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -2413,8 +2413,10 @@ static int edma_probe(struct platform_device *pdev)
ecc->tc_list = devm_kcalloc(dev, ecc->num_tc,
sizeof(*ecc->tc_list), GFP_KERNEL);
- if (!ecc->tc_list)
- return -ENOMEM;
+ if (!ecc->tc_list) {
+ ret = -ENOMEM;
+ goto err_reg1;
+ }
for (i = 0;; i++) {
ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs",
--
2.24.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2] dmaengine: ti: edma: fix missed failure handling
2019-11-18 7:38 [PATCH 2/2] dmaengine: ti: edma: fix missed failure handling Chuhong Yuan
@ 2019-11-22 5:43 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2019-11-22 5:43 UTC (permalink / raw)
To: Chuhong Yuan; +Cc: Dan Williams, dmaengine, linux-kernel
On 18-11-19, 15:38, Chuhong Yuan wrote:
> When devm_kcalloc fails, it forgets to call edma_free_slot.
> Replace direct return with failure handler to fix it.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-22 5:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18 7:38 [PATCH 2/2] dmaengine: ti: edma: fix missed failure handling Chuhong Yuan
2019-11-22 5:43 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).