summaryrefslogtreecommitdiff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2022-01-12 08:15:47 +0300
committerJassi Brar <jaswinder.singh@linaro.org>2022-01-12 08:47:33 +0300
commitaf8d0f6d222d12ed7bba447e5eb277a5908b8968 (patch)
treeed3480139c64fbaf2df5d6ab80410aeb58ee8fd4 /drivers/mailbox
parent2453128847ca1edbecbe33dbe063a04489d64842 (diff)
downloadlinux-af8d0f6d222d12ed7bba447e5eb277a5908b8968.tar.xz
mailbox: mtk: add missing of_node_put before return
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 <wangqing@vivo.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mtk-cmdq-mailbox.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index bd986ab2f384..2578e5aaa935 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -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",