summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mxsfb/mxsfb_drv.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-13 15:23:32 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-13 22:24:20 +0100
commite89e50ac35d9126907a436dabe70f9a8311b9981 (patch)
treea64ba36abd4a1f0922b63220e3705a71b6968b5e /drivers/gpu/drm/mxsfb/mxsfb_drv.c
parent010f5b9f0d44f73943e0b63d7f4362af227ae2ea (diff)
downloadlinux-e89e50ac35d9126907a436dabe70f9a8311b9981.tar.bz2
drm: mxsfb: drm_dev_alloc() returns error pointers
We should be checking for IS_ERR() instead of NULL because drm_dev_alloc() returns error pointers. Fixes: 45d59d704080 ("drm: Add new driver for MXSFB controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161213122332.GA7519@elgon.mountain
Diffstat (limited to 'drivers/gpu/drm/mxsfb/mxsfb_drv.c')
-rw-r--r--drivers/gpu/drm/mxsfb/mxsfb_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 79a18bf48b54..955441f71500 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -395,8 +395,8 @@ static int mxsfb_probe(struct platform_device *pdev)
pdev->id_entry = of_id->data;
drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev);
- if (!drm)
- return -ENOMEM;
+ if (IS_ERR(drm))
+ return PTR_ERR(drm);
ret = mxsfb_load(drm, 0);
if (ret)