Linux clock framework development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jiawen Liu" <liu1298662399@gmail.com>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors
Date: Sun, 29 Nov 2026 19:42:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-239977@kernel.org> (raw)
In-Reply-To: <179598033933.2.16274950563244133260.pattern-ext-106.14@gmail.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] clk: samsung: ERR_PTR dereference in exynos_arm64_cmu_resume()
  [1]
--

commit e3d194f1b1626249b01718daea54f9d69a2fb097
Author: Jiawen Liu <liu1298662399@gmail.com>

clk: samsung: exynos-arm64: Propagate CMU resume clock errors

This commit checks and propagates the return value of clk_prepare_enable()
on data->clk in exynos_arm64_cmu_resume() instead of ignoring errors.

> diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c
> index eac59c8df6fa8..e7e88df15e53a 100644
> --- a/drivers/clk/samsung/clk-exynos-arm64.c
> +++ b/drivers/clk/samsung/clk-exynos-arm64.c
> @@ -359,9 +359,11 @@ int exynos_arm64_cmu_suspend(struct device *dev)
>  int exynos_arm64_cmu_resume(struct device *dev)
>  {
>  	struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev);
> -	int i;
> +	int i, ret;
>  
> -	clk_prepare_enable(data->clk);
> +	ret = clk_prepare_enable(data->clk);
> +	if (ret)
> +		return ret;

[Severity: High]
This problem wasn't introduced by this patch, but can clk_prepare_enable()
dereference an ERR_PTR in data->clk [1]?

In exynos_arm64_enable_bus_clk(), clk_get() is stored into data->clk
before checking IS_ERR(parent_clk):

drivers/clk/samsung/clk-exynos-arm64.c:exynos_arm64_enable_bus_clk() {
	if (dev) {
		struct exynos_arm64_cmu_data *data;

		parent_clk = clk_get(dev, cmu->clk_name);
		data = dev_get_drvdata(dev);
		if (data)
			data->clk = parent_clk;
	}
}

If clk_get() fails, exynos_arm64_register_cmu_pm() logs a warning and
continues registering PM, so a subsequent resume passes the ERR_PTR to
clk_prepare_enable() and crashes.

[1] https://sashiko.dev/#/bug/linux-d237d28a-7387-4379-9bf4-331a7052082c

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179598033933.2.16274950563244133260.pattern-ext-106.14@gmail.com?part=1

      reply	other threads:[~2026-11-29 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 19:25 [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors Jiawen Liu
2026-11-29 19:42 ` sashiko-bot [this message]

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=sashiko-outbox-239977@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=liu1298662399@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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