From: Dan Carpenter Date: Tue, 13 Dec 2016 12:23:32 +0000 (+0300) Subject: drm: mxsfb: drm_dev_alloc() returns error pointers X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e89e50ac35d9126907a436dabe70f9a8311b9981;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161213122332.GA7519@elgon.mountain --- 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)