From: sashiko-bot@kernel.org
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/bridge: sii902x: Read "sil,i2s-data-lanes" as u32
Date: Tue, 18 Aug 2026 23:56:15 +0000 [thread overview]
Message-ID: <20260818235615.7ABA81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260818234621.1265415-1-robh@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Using WARN_ON() to validate device tree input causes unnecessary kernel splats and potential kernel panics.
- [Medium] Breaking out of the initialization loop on invalid lane values leaves the audio data structures in an inconsistent state.
--
--- Patch [1]: [PATCH] drm/bridge: sii902x: Read "sil,i2s-data-lanes" as u32 ---
commit a4b4eceb945fa6ac0b81acc248b81fdebf849bd9
Author: Rob Herring (Arm) <robh@kernel.org>
drm/bridge: sii902x: Read "sil,i2s-data-lanes" as u32
This patch updates the sii902x bridge driver to read the "sil,i2s-data-lanes"
property as a u32 array instead of a u8 array to match the device tree
bindings. It also introduces a bounds check on the array values to prevent
out-of-bounds accesses.
> diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c
> --- a/drivers/gpu/drm/bridge/sii902x.c
> +++ b/drivers/gpu/drm/bridge/sii902x.c
[ ... ]
> @@ -890,9 +890,12 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
> }
> codec_data.max_i2s_channels = 2 * num_lanes;
>
> - for (i = 0; i < num_lanes; i++)
> + for (i = 0; i < num_lanes; i++) {
> + if (WARN_ON(lanes[i] >= ARRAY_SIZE(i2s_lane_id)))
[Severity: Medium]
Is it safe to use WARN_ON() for validating device tree properties?
If panic_on_warn is enabled, couldn't this crash the system when parsing
malformed or untrusted device tree data?
Would it be better to use dev_err() and gracefully fail initialization?
[Severity: Medium]
If this loop breaks early due to an invalid lane, codec_data.max_i2s_channels
remains set to 2 * num_lanes.
Could this cause an inconsistent state where ALSA exposes support for more
channels than the hardware has actually configured in i2s_fifo_sequence?
Should this path return an error (like -EINVAL) to abort audio
initialization, or update the channel count?
> + break;
> sii902x->audio.i2s_fifo_sequence[i] |= audio_fifo_id[i] |
> i2s_lane_id[lanes[i]] | SII902X_TPI_I2S_FIFO_ENABLE;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260818234621.1265415-1-robh@kernel.org?part=1
next prev parent reply other threads:[~2026-08-18 23:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 23:46 [PATCH] drm/bridge: sii902x: Read "sil,i2s-data-lanes" as u32 Rob Herring (Arm)
2026-08-18 23:56 ` sashiko-bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-06-12 21:52 Rob Herring (Arm)
2026-06-12 21:58 ` sashiko-bot
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=20260818235615.7ABA81F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.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 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.