dmaengine: ti: edma: fix missed failure handling
Subsystems (2)
PATCH 2/2 dmaengine: ti: edma: fix missed failure handling
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 <[email protected]>
--- drivers/dma/ti/edma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/dma/ti/edma.c +4 -2
@@ -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",
Signature · 1 line
2.24.0
Quoted 2 lines · Chuhong Yuan
When
devm_kcallocfails, it forgets to calledma_free_slot. Replace direct return with failure handler to fix it.
Applied, thanks
Signature · 1 line
~Vinod