dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [patch] drm: zte: checking for NULL instead of IS_ERR()
@ 2016-11-15  9:53 Dan Carpenter
  2016-11-15 10:00 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-11-15  9:53 UTC (permalink / raw)
  To: Shawn Guo; +Cc: David Airlie, dri-devel, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index abc8099..3e76f72 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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-15 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15  9:53 [patch] drm: zte: checking for NULL instead of IS_ERR() Dan Carpenter
2016-11-15 10:00 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).