[PATCH] drm/omap: dsi: check IS_ERR() on syscon_node_to_regmap() in dsi_probe()
From: Ziheng Wei
Date: Fri Dec 04 2026 - 04:10:55 EST
dsi_probe() stores the return value of syscon_node_to_regmap(np) into
dsi->syscon without checking IS_ERR(). If syscon_node_to_regmap() fails
(for example with -EPROBE_DEFER or -ENOMEM), probe succeeds with an
ERR_PTR stored in dsi->syscon.
When the DSI pads are later enabled, dsi_omap4_mux_pads() and
dsi_omap5_mux_pads() pass dsi->syscon directly to regmap_update_bits(),
dereferencing the ERR_PTR and crashing the kernel.
Check IS_ERR(dsi->syscon) and return PTR_ERR(dsi->syscon) on failure.
Found by LLM-assisted static analysis. Compile-tested on x86_64.
Fixes: 9e1305d0d1fd ("drm: omapdrm: dsi: Handle pin muxing internally")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Ziheng Wei <zihengw03@xxxxxxx>
---
drivers/gpu/drm/omapdrm/dss/dsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 838b34ea7..8ffe66620 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4981,6 +4981,8 @@ static int dsi_probe(struct platform_device *pdev)
dsi->syscon = syscon_node_to_regmap(np);
of_node_put(np);
+ if (IS_ERR(dsi->syscon))
+ return PTR_ERR(dsi->syscon);
}
/* DSI VCs initialization */
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
--
2.43.0