summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>2024-12-19 11:05:07 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:52:28 +0100
commitb0f47b08786de5b02cedcadc88dad77ed4b1e671 (patch)
tree96067f22a614f6c059d6fe42d47bb73e0d88ec65
parent68a5e8b9125b672b08b79e15d1089b819c0a9e33 (diff)
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
[ Upstream commit e883c64778e5a9905fce955681f8ee38c7197e0f ] The .probe() of edma_driver calls of_parse_phandle_with_fixed_args() but does not release the obtained OF nodes. Thus add a of_node_put() call. This bug was found by an experimental verification tool that I am developing. Fixes: 1be5336bc7ba ("dmaengine: edma: New device tree binding") Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20241219020507.1983124-3-joe@pf.is.s.u-tokyo.ac.jp Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/dma/ti/edma.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
index 155c409d2b43..c0fa54132467 100644
--- a/drivers/dma/ti/edma.c
+++ b/drivers/dma/ti/edma.c
@@ -208,7 +208,6 @@ struct edma_desc {
struct edma_cc;
struct edma_tc {
- struct device_node *node;
u16 id;
};
@@ -2466,13 +2465,13 @@ static int edma_probe(struct platform_device *pdev)
if (ret || i == ecc->num_tc)
break;
- ecc->tc_list[i].node = tc_args.np;
ecc->tc_list[i].id = i;
queue_priority_mapping[i][1] = tc_args.args[0];
if (queue_priority_mapping[i][1] > lowest_priority) {
lowest_priority = queue_priority_mapping[i][1];
info->default_queue = i;
}
+ of_node_put(tc_args.np);
}
/* See if we have optional dma-channel-mask array */