]> git.itanic.dy.fi Git - linux-stable/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:10:29 +0000 (11:10 +0200)
commitaa11dae059a439af82bae541b134f8f53ac177b5
tree0773d6db6927ed6e4642a35e4ba1d239e45799dc
parent1cc871fe6d3153e0a782a118061ba2f62c2f6850
dmaengine: ti: k3-udma-private: Fix refcount leak bug in of_xudma_dev_get()

[ Upstream commit f9fdb0b86f087c2b7f6c6168dd0985a3c1eda87e ]

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: d70241913413 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ti/k3-udma-private.c