dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()
authorYu Kuai <yukuai3@huawei.com>
Thu, 18 Jun 2020 13:01:10 +0000 (21:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:19:50 +0000 (10:19 +0200)
commit1a2ce8b723de6e769b5d9e5848b3fa2a2864d51e
tree6ac3017ae6973436966490751cfa10f881ee7c49
parent62928cce6e76e91e8fd8c82c52db0b04b12ece61
dmaengine: ti: k3-udma: add missing put_device() call in of_xudma_dev_get()

[ Upstream commit 1438cde8fe9cb709b569f5829c4c892c0f3f15b3 ]

if of_find_device_by_node() succeed and platform_get_drvdata() failed,
of_xudma_dev_get() will return without put_device(), which will leak
the memory.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20200618130110.582543-1-yukuai3@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/ti/k3-udma-private.c