]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc()
authorChen Ni <nichen@iscas.ac.cn>
Wed, 29 Apr 2026 08:05:27 +0000 (16:05 +0800)
committerNeil Armstrong <neil.armstrong@linaro.org>
Tue, 5 May 2026 13:29:07 +0000 (15:29 +0200)
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>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20260429080527.1456732-1-nichen@iscas.ac.cn
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c

index dd420bb1944073e7dedc9f7861694479982934bd..ed02a8daf96f917974a3806921dd2da693a540e1 100644 (file)
@@ -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;