From: sashiko-bot@kernel.org
To: "Zhang Yi" <zhangyi@everest-semi.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration
Date: Tue, 09 Jun 2026 03:13:41 +0000 [thread overview]
Message-ID: <20260609031341.A64FB1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609030623.17404-5-zhangyi@everest-semi.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing return value checks on regmap_read() in multiple functions leads to use of uninitialized memory.
--
commit 13fc2779b6e0163ece67df605c65dd1048a313c5
Author: Zhang Yi <zhangyi@everest-semi.com>
ASoC: codecs: ES8389: Modify the initial configuration
This commit updates the initial configuration values for the ES8389 codec.
It modifies the register writes for ISO_CTL and OSC_CLK during device
initialization.
> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 6ad0b580068cf..8e47b4e3214e0 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -792,7 +792,7 @@ static void es8389_init(struct snd_soc_component *component)
>
> regmap_read(es8389->regmap, ES8389_MAX_REGISTER, ®);
> es8389->version = reg;
[Severity: High]
This is a pre-existing issue, but is it safe to consume the value of reg
without checking the return value of regmap_read()?
If the underlying bus read fails, regmap_read() returns an error code and
leaves reg unmodified. This means uninitialized stack memory would be
assigned to es8389->version here.
This same pattern appears to exist in several other functions in this
driver where the regmap_read() return value is not checked before
evaluating the output variable. For example, in es8389_resume():
regmap_read(es8389->regmap, ES8389_RESET, ®v);
...
if (regv == 0xff)
And similarly in es8389_mute():
regmap_read(es8389->regmap, ES8389_CSM_STATE1, ®v);
if (regv != ES8389_STATE_ON) {
Could these unchecked reads lead to unpredictable hardware configuration
and incorrect control flow if a bus timeout or error occurs?
> - regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x00);
> + regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x56);
> regmap_write(es8389->regmap, ES8389_RESET, 0x7E);
> regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x38);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609030623.17404-1-zhangyi@everest-semi.com?part=4
next prev parent reply other threads:[~2026-06-09 3:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 3:06 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 3:06 ` [PATCH 1/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
2026-06-09 3:17 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 2/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
2026-06-09 3:20 ` sashiko-bot
2026-06-09 7:34 ` Krzysztof Kozlowski
2026-06-09 3:06 ` [PATCH 3/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
2026-06-09 3:19 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
2026-06-09 3:13 ` sashiko-bot [this message]
2026-06-09 3:06 ` [PATCH 5/7] ASoC: codecs: ES8389: Add private members related to HPF Zhang Yi
2026-06-09 3:06 ` [PATCH 6/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX Zhang Yi
2026-06-09 3:21 ` sashiko-bot
2026-06-09 3:06 ` [PATCH 7/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock Zhang Yi
2026-06-09 7:33 ` Krzysztof Kozlowski
-- strict thread matches above, loose matches on Subject: below --
2026-06-09 7:17 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 7:17 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
2026-06-09 7:26 ` sashiko-bot
2026-06-09 2:55 [PATCH 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-09 2:56 ` [PATCH 4/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
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=20260609031341.A64FB1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zhangyi@everest-semi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.