linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miaoqian Lin <linmq006@gmail.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>,
	Andreas Kemnade <andreas@kemnade.info>,
	Kevin Hilman <khilman@baylibre.com>,
	Roger Quadros <rogerq@kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: linmq006@gmail.com
Subject: [PATCH] bus: ti-sysc: Fix potential double free in sysc_add_named_clock_from_child()
Date: Mon,  4 Aug 2025 20:04:03 +0800	[thread overview]
Message-ID: <20250804120403.97959-1-linmq006@gmail.com> (raw)

The devm_get_clk_from_child() function uses device-managed resources
that are automatically cleaned up. The clk_put() call after
devm_get_clk_from_child() is redundant and
may lead to double-free issues.

Fixes: a54275f4ab20 ("bus: ti-sysc: Add quirk handling for external optional functional clock")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/bus/ti-sysc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 9f624e5da991..5441b0739faa 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -362,7 +362,6 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
 	cl->clk = clock;
 	clkdev_add(cl);
 
-	clk_put(clock);
 
 	return 0;
 }
-- 
2.35.1


             reply	other threads:[~2025-08-04 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04 12:04 Miaoqian Lin [this message]
2025-08-11 14:53 ` [PATCH] bus: ti-sysc: Fix potential double free in sysc_add_named_clock_from_child() Andreas Kemnade
2025-08-18  3:23   ` 林妙倩

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=20250804120403.97959-1-linmq006@gmail.com \
    --to=linmq006@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=andreas@kemnade.info \
    --cc=khilman@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rogerq@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).