summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2023-03-22 10:06:55 +0100
committerJavier Martinez Canillas <javierm@redhat.com>2023-04-15 23:48:48 +0200
commitdae2f7b89a8436351a2982d0d96a8a56accca576 (patch)
tree772a24adcb6a95b8d72f13723cbecdb21f4ed7e9 /drivers/gpu/drm/imx
parentdrm/bridge: fsl-ldb: Add i.MX6SX support (diff)
downloadlinux-dae2f7b89a8436351a2982d0d96a8a56accca576.tar.xz
linux-dae2f7b89a8436351a2982d0d96a8a56accca576.zip
drm/imx/lcdc: fix a NULL vs IS_ERR() bug in probe
The devm_drm_dev_alloc() function returns error pointers. It never returns NULL. Fix the check. Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25") Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/d0a1fc55-3ef6-444e-b3ef-fdc937d8d57a@kili.mountain
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r--drivers/gpu/drm/imx/lcdc/imx-lcdc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
index 8e6d457917da..277ead6a459a 100644
--- a/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
+++ b/drivers/gpu/drm/imx/lcdc/imx-lcdc.c
@@ -400,8 +400,8 @@ static int imx_lcdc_probe(struct platform_device *pdev)
lcdc = devm_drm_dev_alloc(dev, &imx_lcdc_drm_driver,
struct imx_lcdc, drm);
- if (!lcdc)
- return -ENOMEM;
+ if (IS_ERR(lcdc))
+ return PTR_ERR(lcdc);
drm = &lcdc->drm;