From: Dan Carpenter Date: Tue, 15 Nov 2016 09:53:01 +0000 (+0300) Subject: drm: zte: checking for NULL instead of IS_ERR() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=72282a88d4ea2c0f3e520fab34db56af7119f6e7;p=openwrt%2Fstaging%2Fblogic.git drm: zte: checking for NULL instead of IS_ERR() drm_dev_alloc() never returns NULL, it only returns error pointers on error. Fixes: 0a886f59528a ("drm: zte: add initial vou drm driver") Signed-off-by: Dan Carpenter Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161115095301.GC15424@mwanda --- diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index abc8099e6f53..3e76f72c92ff 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -107,8 +107,8 @@ static int zx_drm_bind(struct device *dev) return -ENOMEM; drm = drm_dev_alloc(&zx_drm_driver, dev); - if (!drm) - return -ENOMEM; + if (IS_ERR(drm)) + return PTR_ERR(drm); drm->dev_private = priv; dev_set_drvdata(dev, drm);