[PATCH v2 05/15] drm/bridge: inno-hdmi: Allow the register map to come from a parent
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Aug 28 06:54:53 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Uninitialized variable 'val' is returned if regmap_read() fails
--
commit a6bf796635499ff8cec94a1fb87f0e5e4fc66897
Author: Michal Wilczynski <m.wilczynski at samsung.com>
drm/bridge: inno-hdmi: Allow the register map to come from a parent
This commit updates the inno-hdmi driver to use a regmap supplied by the
parent device if available, falling back to mapping its own resource
otherwise. This allows sharing the register space on SoCs where the HDMI
controller does not exclusively own the register window.
> diff --git a/drivers/gpu/drm/bridge/inno-hdmi.c b/drivers/gpu/drm/bridge/inno-hdmi.c
> index 12fd208d5e852..ebc5093f13ac4 100644
> --- a/drivers/gpu/drm/bridge/inno-hdmi.c
> +++ b/drivers/gpu/drm/bridge/inno-hdmi.c
[ ... ]
> @@ -470,11 +471,23 @@ static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi,
>
> static inline u8 hdmi_readb(struct inno_hdmi *hdmi, u16 offset)
> {
> + u32 val;
> +
> + if (hdmi->regmap) {
> + regmap_read(hdmi->regmap, offset * 4, &val);
> + return val;
[Severity: Medium]
Does this return uninitialized stack memory if regmap_read() fails?
If regmap_read() fails (e.g., due to an out-of-bounds offset, disabled
clock, or other regmap configuration issues), it returns a negative error
code and does not populate val. The function appears to ignore the return
value and blindly returns the uninitialized stack variable. Callers that
use this value for hardware logic might behave erratically if random stack
data is interpreted as register contents.
> + }
> +
> return readl_relaxed(hdmi->regs + (offset) * 0x04);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828-jh7110-clean-send-v2-0-331680c8b9d1@samsung.com?part=5
More information about the linux-phy
mailing list