From: sashiko-bot@kernel.org
To: "Binbin Zhou" <zhoubinbin@loongson.cn>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 5/7] ASoC: loongson: Add Loongson-2K0300 CTCISZ Forever Pi sound card support
Date: Thu, 04 Jun 2026 02:26:38 +0000 [thread overview]
Message-ID: <20260604022638.B07331F00893@smtp.kernel.org> (raw)
In-Reply-To: <1b2fa7b37c354df6ac7b2c1c5f9f3fac2b8af3ff.1780538113.git.zhoubinbin@loongson.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Uninitialized pointer `codec_dai_name` is used if the required device property is missing.
--
commit ca8a45881e3592679d02b8f941222c143f73d4c0
Author: Binbin Zhou <zhoubinbin@loongson.cn>
ASoC: loongson: Add Loongson-2K0300 CTCISZ Forever Pi sound card support
The Loongson-2K0300 audio card uses a different DAI format compared to
existing Loongson platforms. Move the dai_fmt setting from the static DAI
link to runtime hw_params via snd_soc_runtime_set_dai_fmt(), and pass the
correct format through driver match data.
> diff --git a/sound/soc/loongson/loongson_card.c b/sound/soc/loongson/loongson_card.c
> index 7910d5d9ac4ff..9200e8476c1fa 100644
> --- a/sound/soc/loongson/loongson_card.c
> +++ b/sound/soc/loongson/loongson_card.c
[ ... ]
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing this file I
noticed a pre-existing issue in loongson_card_parse_acpi().
Is it possible for the "codec-dai-name" device property to be missing?
In loongson_card_parse_acpi(), codec_dai_name is declared without being
initialized:
const char *codec_dai_name;
...
device_property_read_string(card->dev, "codec-dai-name", &codec_dai_name);
for (i = 0; i < card->num_links; i++) {
loongson_dai_links[i].platforms->name = dev_name(phy_dev);
loongson_dai_links[i].codecs->name = codec_name;
loongson_dai_links[i].codecs->dai_name = codec_dai_name;
}
If device_property_read_string() returns an error because the property is
missing, codec_dai_name remains uninitialized garbage. This garbage pointer
is then assigned to the global loongson_dai_links[i].codecs->dai_name,
which ASoC core will dereference during component matching.
Could this lead to a kernel panic if the firmware lacks this property? Should
the return value of device_property_read_string() be checked or a default
value be provided?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1780538113.git.zhoubinbin@loongson.cn?part=5
next prev parent reply other threads:[~2026-06-04 2:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-04 2:11 [PATCH v2 0/7] ASoC: Add Loongson-2K0300 I2S controller and sound card support Binbin Zhou
2026-06-04 2:11 ` [PATCH v2 1/7] ASoC: dt-bindings: loongson,ls2k1000-i2s: Document Loongson-2K0300 compatible Binbin Zhou
2026-06-04 2:11 ` [PATCH v2 2/7] ASoC: loongson: Add Loongson-2K0300 I2S controller support Binbin Zhou
2026-06-04 2:24 ` sashiko-bot
2026-06-04 2:11 ` [PATCH v2 3/7] ASoC: dt-bindings: loongson,ls-audio-card: Use common sound card Binbin Zhou
2026-06-04 2:11 ` [PATCH v2 4/7] ASoC: dt-bindings: loongson,ls-audio-card: Add ctcisz forever pi compatible Binbin Zhou
2026-06-04 2:21 ` sashiko-bot
2026-06-04 2:11 ` [PATCH v2 5/7] ASoC: loongson: Add Loongson-2K0300 CTCISZ Forever Pi sound card support Binbin Zhou
2026-06-04 2:26 ` sashiko-bot [this message]
2026-06-04 2:11 ` [PATCH v2 6/7] ASoC: dt-bindings: loongson,ls-audio-card: Add ATK-DL2K0300B compatible Binbin Zhou
2026-06-04 2:11 ` [PATCH v2 7/7] ASoC: loongson: Add headphone jack detection and DAPM routing Binbin Zhou
2026-06-04 2:27 ` sashiko-bot
2026-06-04 14:56 ` Mark Brown
2026-06-05 1:25 ` Binbin Zhou
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=20260604022638.B07331F00893@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=zhoubinbin@loongson.cn \
/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.