drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc()
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/panel/panel-focaltech-ota7290b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c +2 -2
@@ -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;
Signature · 1 line
2.25.1
Quoted 15 lines · Chen Ni
The
devm_drm_panel_alloc()function returns an error pointer on failure, not NULL. Fix the check to useIS_ERR()and returnPTR_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 <[email protected]>--- drivers/gpu/drm/panel/panel-focaltech-ota7290b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/panel/panel-focaltech-ota7290b.c +0
-0
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c static int ota7290b_probe(struct mipi_dsi_device *dsi) · line 163
Quoted 10 lines
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c +2
-2@@ -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;
Thanks,
Neil
Hi,
Quoted 3 lines · Chen Ni
The
devm_drm_panel_alloc()function returns an error pointer on failure, not NULL. Fix the check to useIS_ERR()and returnPTR_ERR()to correctly handle allocation failures.
Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)
[1/1] drm/panel: focaltech-ota7290b: Fix error check for devm_drm_panel_alloc()
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/71fa1bccaa957b0f51c1e1bedff2541741ec2b0c
Signature · 1 line
Neil