All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhang Yi" <zhangyi@everest-semi.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v1 5/7] ASoC: codecs: ES8389: Modify the initial configuration
Date: Thu, 11 Jun 2026 03:26:03 +0000	[thread overview]
Message-ID: <20260611032604.3B04A1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260611031824.4628-6-zhangyi@everest-semi.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The return values of multiple `regmap_read()` calls are ignored, leading to the use of uninitialized stack variables.
--

commit eeca5823fe9bef5ffe179596ec0a3aab2d9ba07a
Author: Zhang Yi <zhangyi@everest-semi.com>

ASoC: codecs: ES8389: Modify the initial configuration

Modify the initial configuration.

> diff --git a/sound/soc/codecs/es8389.c b/sound/soc/codecs/es8389.c
> index 647d9d62820e6..284eb707f9f7f 100644
> --- a/sound/soc/codecs/es8389.c
> +++ b/sound/soc/codecs/es8389.c
> @@ -793,7 +793,7 @@ static void es8389_init(struct snd_soc_component *component)
>  
>  	regmap_read(es8389->regmap, ES8389_MAX_REGISTER, &reg);
>  	es8389->version = reg;

[Severity: High]
This isn't a bug introduced by this patch, but I noticed the return value of
regmap_read() is ignored here. If the read fails, 'reg' will remain
uninitialized, and es8389->version will be corrupted with stack garbage.

Could this also cause unpredictable behavior in other parts of the driver?
Similar unchecked regmap_read() calls seem to exist in:
- es8389_pcm_hw_params() (corrupting dmic_enable)
- es8389_mute() (triggering spurious state changes)
- es8389_resume() (potentially triggering es8389_init() erroneously)

> -	regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x00);
> +	regmap_write(es8389->regmap, ES8389_ISO_CTL, 0x56);
>  	regmap_write(es8389->regmap, ES8389_RESET, 0x7E);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260611031824.4628-1-zhangyi@everest-semi.com?part=5

  reply	other threads:[~2026-06-11  3:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  3:18 [PATCH v1 0/7] ASoC: codecs: ES8389: Modify the ES8389 driver Zhang Yi
2026-06-11  3:18 ` [PATCH v1 1/7] ASoC: dt-bindings: ES8389: Add members about HPF and clock Zhang Yi
2026-06-11  3:28   ` sashiko-bot
2026-06-11 10:45   ` Krzysztof Kozlowski
2026-06-11 10:51     ` Krzysztof Kozlowski
2026-06-11 11:16       ` Zhang Yi
2026-06-11 11:30     ` Zhang Yi
2026-06-11  3:18 ` [PATCH v1 2/7] ASoC: codecs: ES8389: Modify volatile_register Zhang Yi
2026-06-11  3:31   ` sashiko-bot
2026-06-11  3:18 ` [PATCH v1 3/7] ASoC: codecs: ES8389: Fix the issue about mclk_src Zhang Yi
2026-06-11  3:32   ` sashiko-bot
2026-06-11 10:46   ` Krzysztof Kozlowski
2026-06-11 12:01     ` Zhang Yi
2026-06-11  3:18 ` [PATCH v1 4/7] ASoC: codecs: ES8389: Modify the clock table Zhang Yi
2026-06-11  3:27   ` sashiko-bot
2026-06-11  3:18 ` [PATCH v1 5/7] ASoC: codecs: ES8389: Modify the initial configuration Zhang Yi
2026-06-11  3:26   ` sashiko-bot [this message]
2026-06-11  3:18 ` [PATCH v1 6/7] ASoC: codecs: ES8389: Add private members related to HPF Zhang Yi
2026-06-11  3:18 ` [PATCH v1 7/7] ASoC: codecs: ES8389: Add INPUTL MUX and INPUTR MUX 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=20260611032604.3B04A1F00893@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.