diff options
author | Dan Carpenter <error27@gmail.com> | 2023-03-22 12:06:55 +0300 |
---|---|---|
committer | Javier Martinez Canillas <javierm@redhat.com> | 2023-04-16 00:48:48 +0300 |
commit | dae2f7b89a8436351a2982d0d96a8a56accca576 (patch) | |
tree | 772a24adcb6a95b8d72f13723cbecdb21f4ed7e9 /drivers | |
parent | ebb7619d3ac85d7aae0a5e8d7038d32211ca7dba (diff) | |
download | linux-dae2f7b89a8436351a2982d0d96a8a56accca576.tar.xz |
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')
-rw-r--r-- | drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 4 |
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; |