[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211018013314.4535-1-wanjiabing@vivo.com>
Date: Sun, 17 Oct 2021 21:33:14 -0400
From: Wan Jiabing <wanjiabing@...o.com>
To: Jassi Brar <jassisinghbrar@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Cc: kael_w@...h.net, Wan Jiabing <wanjiabing@...o.com>
Subject: [PATCH] mailbox: cmdq: Add of_node_put() before return
Fix following coccicheck warning:
./drivers/mailbox/mtk-cmdq-mailbox.c:572:2-24: 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: Wan Jiabing <wanjiabing@...o.com>
---
drivers/mailbox/mtk-cmdq-mailbox.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 64175a893312..ab4f42cc987d 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -579,6 +579,7 @@ static int cmdq_probe(struct platform_device *pdev)
cmdq->clocks[alias_id].clk = of_clk_get(node, 0);
if (IS_ERR(cmdq->clocks[alias_id].clk)) {
dev_err(dev, "failed to get gce clk: %d\n", alias_id);
+ of_node_put(node);
return PTR_ERR(cmdq->clocks[alias_id].clk);
}
}
--
2.20.1
Powered by blists - more mailing lists