From 0f2886057be322ddfa4858384c40a505f7a32a4a Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 21 Sep 2016 16:59:19 +0200 Subject: drm: Don't swallow error codes in drm_dev_alloc() There are many reasons other than ENOMEM that drm_dev_init() can fail. Return ERR_PTR rather than NULL to be able to distinguish these in the caller. Signed-off-by: Tom Gundersen Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/20160921145919.13754-2-teg@jklm.no --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/mediatek/mtk_drm_drv.c') diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 72c1ae4e02d4..cf83f6507ec8 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -294,8 +294,8 @@ static int mtk_drm_bind(struct device *dev) int ret; drm = drm_dev_alloc(&mtk_drm_driver, dev); - if (!drm) - return -ENOMEM; + if (IS_ERR(drm)) + return PTR_ERR(drm); drm->dev_private = private; private->drm = drm; -- cgit v1.2.1