public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: "Alexander A. Klimov" <grandmaster@al2klimov•de>
To: Krzysztof Kozlowski <krzk@kernel•org>,
	Michael Turquette <mturquette@baylibre•com>,
	Stephen Boyd <sboyd@kernel•org>,
	Brian Masney <bmasney@redhat•com>,
	Jonas Jensen <jonas.jensen@gmail•com>,
	Mike Turquette <mturquette@linaro•org>,
	linux-arm-kernel@lists•infradead.org (moderated list:ARM/MOXA
	ART SOC),
	linux-clk@vger•kernel.org (open list:COMMON CLK FRAMEWORK),
	linux-kernel@vger•kernel.org (open list)
Cc: "Alexander A. Klimov" <grandmaster@al2klimov•de>
Subject: [PATCH] clk: moxart: fix refcount leak
Date: Wed, 20 May 2026 19:55:50 +0200	[thread overview]
Message-ID: <20260520175552.537603-1-grandmaster@al2klimov.de> (raw)

Every value returned from of_clk_get() is supposed to be cleaned up
via clk_put() once not needed anymore.
The values here are used only for error checking,
but weren't cleaned up until now.

Fixes: c7bb4fc16ead ("clk: add MOXA ART SoCs clock driver")
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov•de>
---
 drivers/clk/clk-moxart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/clk-moxart.c b/drivers/clk/clk-moxart.c
index 3786a0153ad1..7e191b1481bb 100644
--- a/drivers/clk/clk-moxart.c
+++ b/drivers/clk/clk-moxart.c
@@ -39,6 +39,7 @@ static void __init moxart_of_pll_clk_init(struct device_node *node)
 		pr_err("%pOF: of_clk_get failed\n", node);
 		return;
 	}
+	clk_put(ref_clk);
 
 	hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, mul, 1);
 	if (IS_ERR(hw)) {
@@ -83,6 +84,7 @@ static void __init moxart_of_apb_clk_init(struct device_node *node)
 		pr_err("%pOF: of_clk_get failed\n", node);
 		return;
 	}
+	clk_put(pll_clk);
 
 	hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, 1, div);
 	if (IS_ERR(hw)) {
-- 
2.54.0



             reply	other threads:[~2026-05-20 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 17:55 Alexander A. Klimov [this message]
2026-05-20 22:29 ` [PATCH] clk: moxart: fix refcount leak Brian Masney
2026-05-21  4:16   ` Alexander A. Klimov
2026-05-26 17:45     ` Brian Masney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260520175552.537603-1-grandmaster@al2klimov.de \
    --to=grandmaster@al2klimov$(echo .)de \
    --cc=bmasney@redhat$(echo .)com \
    --cc=jonas.jensen@gmail$(echo .)com \
    --cc=krzk@kernel$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-clk@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=mturquette@baylibre$(echo .)com \
    --cc=mturquette@linaro$(echo .)org \
    --cc=sboyd@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox