]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mailbox: mtk: add missing of_node_put before return
authorWang Qing <wangqing@vivo.com>
Wed, 12 Jan 2022 05:15:47 +0000 (23:15 -0600)
committerJassi Brar <jaswinder.singh@linaro.org>
Wed, 12 Jan 2022 05:47:33 +0000 (23:47 -0600)
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>
drivers/mailbox/mtk-cmdq-mailbox.c

index bd986ab2f384078ee6356a2e41360d5db241c8db..2578e5aaa935f25c6b31e6f6251cc6580b192bed 100644 (file)
@@ -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",