Skip to content

Commit e883c64

Browse files
joehattorivinodkoul
authored andcommitted
dmaengine: ti: edma: fix OF node reference leaks in edma_driver
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]>
1 parent 0ab4331 commit e883c64

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
@@ -208,7 +208,6 @@ struct edma_desc {
208208
struct edma_cc;
209209

210210
struct edma_tc {
211-
struct device_node *node;
212211
u16 id;
213212
};
214213

@@ -2466,13 +2465,13 @@ static int edma_probe(struct platform_device *pdev)
24662465
if (ret)
24672466
break;
24682467

2469-
ecc->tc_list[i].node = tc_args.np;
24702468
ecc->tc_list[i].id = i;
24712469
queue_priority_mapping[i][1] = tc_args.args[0];
24722470
if (queue_priority_mapping[i][1] > lowest_priority) {
24732471
lowest_priority = queue_priority_mapping[i][1];
24742472
info->default_queue = i;
24752473
}
2474+
of_node_put(tc_args.np);
24762475
}
24772476

24782477
/* See if we have optional dma-channel-mask array */

0 commit comments

Comments
 (0)