From: Chen Ni Date: Wed, 29 Apr 2026 08:05:27 +0000 (+0800) Subject: drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc() X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=71fa1bccaa957b0f51c1e1bedff2541741ec2b0c;p=thirdparty%2Flinux.git drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc() 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 Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20260429080527.1456732-1-nichen@iscas.ac.cn --- 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;