public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: chiffathefox <chiffathefoxx@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: chiffathefox <chiffathefoxx@gmail.com>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Lukasz Majewski <lukma@denx.de>,
	Minkyu Kang <mk7.kang@samsung.com>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	u-boot@lists.denx.de
Subject: [PATCH 2/2] clk: exynos: do not reparent requested clock
Date: Thu, 15 Jan 2026 05:11:14 +0200	[thread overview]
Message-ID: <20260115031114.220888-3-chiffathefoxx@gmail.com> (raw)
In-Reply-To: <20260115031114.220888-1-chiffathefoxx@gmail.com>

It would appear the original developer of this driver
reparented child clock devices to fix the issue described in
`clk: clk_resolve_parent_clk(): resolve external clocks by id`.
This hacky fix was the cause of invalid memory access when calling
clk_get_rate() on a clock retrieved via clk_get_by_index().
clk_get_by_index() returns a copy of the `struct clk` and
when passed to clk_get_rate() it may be forwarded to
clk_divider_recalc_rate(), which will cause the latter to
run container_of() on a pointer from caller's stack instead
of the pointer that was kzalloc()'d by the clk-divider driver.

Signed-off-by: chiffathefox <chiffathefoxx@gmail.com>
---

 drivers/clk/exynos/clk.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/exynos/clk.c b/drivers/clk/exynos/clk.c
index a2c9f4851da..aa4d4112db7 100644
--- a/drivers/clk/exynos/clk.c
+++ b/drivers/clk/exynos/clk.c
@@ -19,7 +19,6 @@ int samsung_clk_request(struct clk *clk)
 	if (ret)
 		return ret;
 
-	clk->dev = c->dev;
 	return 0;
 }
 
-- 
2.34.1


  parent reply	other threads:[~2026-01-15  4:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15  3:11 [PATCH 0/2] Improvements to the recent clock rework by marex chiffathefox
2026-01-15  3:11 ` [PATCH 1/2] clk: clk_resolve_parent_clk(): resolve external clocks by id chiffathefox
2026-01-17  1:38   ` Marek Vasut
2026-01-19 16:59   ` Kaustabh Chakraborty
2026-01-15  3:11 ` chiffathefox [this message]
2026-01-19 17:00   ` [PATCH 2/2] clk: exynos: do not reparent requested clock Kaustabh Chakraborty

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=20260115031114.220888-3-chiffathefoxx@gmail.com \
    --to=chiffathefoxx@gmail.com \
    --cc=kauschluss@disroot.org \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=mk7.kang@samsung.com \
    --cc=semen.protsenko@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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