Skip to content

Commit

Permalink
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
Browse files Browse the repository at this point in the history
[ Upstream commit e883c64 ]

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: 1be5336 ("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>
  • Loading branch information
joehattori authored and gregkh committed Feb 8, 2025
1 parent 68a5e8b commit b0f47b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/dma/ti/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ struct edma_desc {
struct edma_cc;

struct edma_tc {
struct device_node *node;
u16 id;
};

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit b0f47b0

Please sign in to comment.