Commit 50987d4e authored by Chen Ni's avatar Chen Ni Committed by Neil Armstrong
Browse files

drm/panel: himax-hx83121a: Fix incorrect error check for devm_drm_panel_alloc()



Check devm_drm_panel_alloc() return value for ERR_PTR instead of NULL.
devm_drm_panel_alloc() returns an ERR_PTR on failure, never NULL. Using
a NULL check skips the error path and may cause a NULL pointer
dereference.

Fixes: a7c61963 ("drm/panel: Add Himax HX83121A panel driver")
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Reviewed-by: default avatarPengyu Luo <mitltlatltl@gmail.com>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260327021728.647182-1-nichen@iscas.ac.cn
parent 3780c414
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -596,8 +596,8 @@ static int himax_probe(struct mipi_dsi_device *dsi)

	ctx = devm_drm_panel_alloc(dev, struct himax, panel, &himax_panel_funcs,
				   DRM_MODE_CONNECTOR_DSI);
	if (!ctx)
		return -ENOMEM;
	if (IS_ERR(ctx))
		return PTR_ERR(ctx);

	ret = devm_regulator_bulk_get_const(&dsi->dev,
					    ARRAY_SIZE(himax_supplies),