Skip to content

Commit

Permalink
mailbox: mtk: add missing of_node_put before return
Browse files Browse the repository at this point in the history
Fix following coccicheck warning:
WARNING: Function "for_each_child_of_node"
should have of_node_put() before return.

Early exits from for_each_child_of_node should decrement the
node reference counter.

Signed-off-by: Wang Qing <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
  • Loading branch information
Wang Qing authored and JassiBrar committed Jan 12, 2022
1 parent 2453128 commit af8d0f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mailbox/mtk-cmdq-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ static int cmdq_probe(struct platform_device *pdev)
cmdq->clocks[alias_id].id = clk_names[alias_id];
cmdq->clocks[alias_id].clk = of_clk_get(node, 0);
if (IS_ERR(cmdq->clocks[alias_id].clk)) {
of_node_put(node);
return dev_err_probe(dev,
PTR_ERR(cmdq->clocks[alias_id].clk),
"failed to get gce clk: %d\n",
Expand Down

0 comments on commit af8d0f6

Please sign in to comment.