Skip to content

Commit ca4c17f

Browse files
WillLestergregkh
authored andcommitted
dmaengine: ti: edma: fix missed failure handling
[ Upstream commit 340049d ] When devm_kcalloc fails, it forgets to call edma_free_slot. Replace direct return with failure handler to fix it. Fixes: 1be5336 ("dmaengine: edma: New device tree binding") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20191118073802.28424-1-hslester96@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c1b9854 commit ca4c17f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/dma/ti/edma.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,8 +2403,10 @@ static int edma_probe(struct platform_device *pdev)
24032403

24042404
ecc->tc_list = devm_kcalloc(dev, ecc->num_tc,
24052405
sizeof(*ecc->tc_list), GFP_KERNEL);
2406-
if (!ecc->tc_list)
2407-
return -ENOMEM;
2406+
if (!ecc->tc_list) {
2407+
ret = -ENOMEM;
2408+
goto err_reg1;
2409+
}
24082410

24092411
for (i = 0;; i++) {
24102412
ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs",

0 commit comments

Comments
 (0)