If of_dma_controller_register() fails, the error path omits the return
statement, causing probe to continue (and eventually succeed) despite
the DMA controller not being registered. Add the missing return rc;.

Fixes: 2e1136acf8a8 ("dmaengine: omap-dma: fix dma_pool resource leak in error 
paths")
Cc: [email protected]
Assisted-by: Opencode:BigPickle
Signed-off-by: Rosen Penev <[email protected]>
---
 drivers/dma/ti/omap-dma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
index 55ece7fd0d99..0f6dd6b0a301 100644
--- a/drivers/dma/ti/omap-dma.c
+++ b/drivers/dma/ti/omap-dma.c
@@ -1828,6 +1828,7 @@ static int omap_dma_probe(struct platform_device *pdev)
                        if (od->ll123_supported)
                                dma_pool_destroy(od->desc_pool);
                        omap_dma_free(od);
+                       return rc;
                }
        }
 
-- 
2.54.0


Reply via email to