Skip to contentSkip to conversation

drm: zte: checking for NULL instead of IS_ERR()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 15, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
drivers/gpu/drm/zte/zx_drm_drv.c +2 -2
index abc8099..3e76f72 100644
@@ -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);
#1 lore raw
Quoted 5 lines · Dan Carpenter

drm_dev_alloc() never returns NULL, it only returns error pointers on error.

Fixes 0a886f59528a ("drm: zte: add initial vou drm driver")

Applied, thx.
-Daniel

Quoted 20 lines
drivers/gpu/drm/zte/zx_drm_drv.c +2 -2
index abc8099..3e76f72 100644
@@ -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);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch