Skip to content

Commit 5a5a359

Browse files
joehattoriSherryYang1
authored andcommitted
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
[ 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 <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 5057f4d0cf65e2b23121784b7d5b79c19af3b4f5) Signed-off-by: Sherry Yang <[email protected]>
1 parent 9843d30 commit 5a5a359

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/dma/ti/edma.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ struct edma_desc {
217217
struct edma_cc;
218218

219219
struct edma_tc {
220-
struct device_node *node;
221220
u16 id;
222221
};
223222

@@ -2414,13 +2413,13 @@ static int edma_probe(struct platform_device *pdev)
24142413
if (ret || i == ecc->num_tc)
24152414
break;
24162415

2417-
ecc->tc_list[i].node = tc_args.np;
24182416
ecc->tc_list[i].id = i;
24192417
queue_priority_mapping[i][1] = tc_args.args[0];
24202418
if (queue_priority_mapping[i][1] > lowest_priority) {
24212419
lowest_priority = queue_priority_mapping[i][1];
24222420
info->default_queue = i;
24232421
}
2422+
of_node_put(tc_args.np);
24242423
}
24252424
}
24262425

0 commit comments

Comments
 (0)