]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get()
authorLiang He <windhl@126.com>
Wed, 20 Jul 2022 07:32:34 +0000 (15:32 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Sep 2022 06:23:46 +0000 (11:53 +0530)
commitf60781f645fdd60dcf48b672b7c4aa98590f77d9
treeeebfa689f6f5660b667e104d894b1ff8f4b836c5
parent49056862f95c81b55d6f432e7c3024be2732c9e4
dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get()

We should call of_node_put() for the reference returned by
of_parse_phandle() in fail path or when it is not used anymore.
Here we only need to move the of_node_put() before the check.

Fixes: d3356a9eef77 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users")
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20220720073234.1255474-1-windhl@126.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma-private.c