public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc()
@ 2026-04-29  8:05 Chen Ni
  2026-04-30  9:45 ` neil.armstrong
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chen Ni @ 2026-04-29  8:05 UTC (permalink / raw)
  To: neil.armstrong, jesszhan0024; +Cc: dmitry.baryshkov, linusw, dri-devel, Chen Ni

The devm_drm_panel_alloc() function returns an error pointer on failure,
not NULL. Fix the check to use IS_ERR() and return PTR_ERR() to
correctly handle allocation failures.

Fixes: 07853e954248 ("drm/panel: add driver for Waveshare 8.8" DSI TOUCH-A panel")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/gpu/drm/panel/panel-focaltech-ota7290b.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-focaltech-ota7290b.c b/drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
index dd420bb19440..ed02a8daf96f 100644
--- a/drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
+++ b/drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
@@ -156,8 +156,8 @@ static int ota7290b_probe(struct mipi_dsi_device *dsi)
 	ctx = devm_drm_panel_alloc(&dsi->dev, struct ota7290b, panel,
 				   &ota7290b_funcs,
 				   DRM_MODE_CONNECTOR_DSI);
-	if (!ctx)
-		return -ENOMEM;
+	if (IS_ERR(ctx))
+		return PTR_ERR(ctx);
 	mipi_dsi_set_drvdata(dsi, ctx);
 	ctx->dsi = dsi;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-05  1:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29  8:05 [PATCH] drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc() Chen Ni
2026-04-30  9:45 ` neil.armstrong
2026-05-05  1:48 ` Claude review: " Claude Code Review Bot
2026-05-05  1:48 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox