[PATCH next] drm/panel: himax-hx83121a: Fix NULL vs IS_ERR() check in probe()

Dan Carpenter posted 1 patch 2 months ago
drivers/gpu/drm/panel/panel-himax-hx83121a.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH next] drm/panel: himax-hx83121a: Fix NULL vs IS_ERR() check in probe()
Posted by Dan Carpenter 2 months ago
The devm_drm_panel_alloc() function never returns NULL, it returns error
pointers on failure.

Fixes: a7c61963b727 ("drm/panel: Add Himax HX83121A panel driver")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
This email is a free service from the Smatch-CI project [smatch.sf.net].

 drivers/gpu/drm/panel/panel-himax-hx83121a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-himax-hx83121a.c b/drivers/gpu/drm/panel/panel-himax-hx83121a.c
index ebe643ba4184..bed79aa06f46 100644
--- a/drivers/gpu/drm/panel/panel-himax-hx83121a.c
+++ b/drivers/gpu/drm/panel/panel-himax-hx83121a.c
@@ -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),
-- 
2.53.0
Re: [PATCH next] drm/panel: himax-hx83121a: Fix NULL vs IS_ERR() check in probe()
Posted by Pengyu Luo 2 months ago
On Fri, Apr 10, 2026 at 6:12 PM Dan Carpenter <error27@gmail.com> wrote:
>
> The devm_drm_panel_alloc() function never returns NULL, it returns error
> pointers on failure.
>
> Fixes: a7c61963b727 ("drm/panel: Add Himax HX83121A panel driver")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---

Sorry, Chen Ni had sent it.
https://lore.kernel.org/dri-devel/20260327021728.647182-1-nichen@iscas.ac.cn/

--
Pengyu