Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Xuyang Dong" <dongxuyang@eswincomputing.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org,
	krzk+dt@kernel.org
Subject: Re: [PATCH v4 2/3] clk: eswin: Add eic7700 HSP clock driver
Date: Wed, 13 May 2026 03:23:17 +0000	[thread overview]
Message-ID: <20260513032318.02072C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260512020747.993-1-dongxuyang@eswincomputing.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The variable `val` is used uninitialized if `regmap_read()` fails in `hsp_clk_gate_is_enabled()`.
--

commit d3ad8b72eab107c1eceac1316c7d04ee9daab08d
Author: Xuyang Dong <dongxuyang@eswincomputing.com>

clk: eswin: Add eic7700 HSP clock driver

Add driver for the ESWIN EIC7700 high-speed peripherals system
clock controller and register an auxiliary device for system
reset controller which is named as "hsp-reset".

> diff --git a/drivers/clk/eswin/clk-eic7700-hsp.c b/drivers/clk/eswin/clk-eic7700-hsp.c
> new file mode 100644
> index 0000000000000..0d5bd5b705dc5
> --- /dev/null
> +++ b/drivers/clk/eswin/clk-eic7700-hsp.c

[ ... ]

> +static int hsp_clk_gate_is_enabled(struct clk_hw *hw)
> +{
> +	struct eic7700_hsp_clk_gate *gate = to_gate_clk(hw);
> +	unsigned int val;
> +
> +	regmap_read(gate->regmap, gate->reg, &val);

If regmap_read() fails and returns an error code, does it leave the val
variable uninitialized?

> +
> +	return !!(val & BIT(gate->bit_idx));

Could the clock framework evaluate this uninitialized stack memory as the
clock's state?

If a random garbage value is returned, could it lead to subsequent
synchronization or power-management issues, such as improperly disabling
an active clock?

> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260512020432.671-1-dongxuyang@eswincomputing.com?part=2

  parent reply	other threads:[~2026-05-13  3:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12  2:04 [PATCH v4 0/3] Add driver support for ESWIN EIC7700 HSP clock and reset generator dongxuyang
2026-05-12  2:05 ` [PATCH v4 1/3] dt-bindings: clock: Add ESWIN eic7700 " dongxuyang
2026-05-12 15:48   ` Brian Masney
2026-05-12 16:40     ` Conor Dooley
2026-05-12 17:27       ` Brian Masney
2026-05-12  2:07 ` [PATCH v4 2/3] clk: eswin: Add eic7700 HSP clock driver Xuyang Dong
2026-05-12 15:45   ` Brian Masney
2026-05-13  3:23   ` sashiko-bot [this message]
2026-05-12  2:08 ` [PATCH v4 3/3] reset: eswin: Add eic7700 HSP reset driver dongxuyang

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=20260513032318.02072C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dongxuyang@eswincomputing.com \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --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