Skip to contentSkip to conversation

drm/vc4: checking for NULL instead of IS_ERR

PATCH In review Dan Carpenter 2 participants 2 messages Nov 4, 2015 – Nov 5, 2015

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

PATCH 1/1 drm/vc4: checking for NULL instead of IS_ERR

vc4_plane_init() returns an ERR_PTR on error, it doesn't return NULL. This was obviously intended because the next lines call PTR_ERR(primary_plane) already.

Fixes c8b75bca92cb ('Eric Anholt <[email protected]>')
drivers/gpu/drm/vc4/vc4_crtc.c +2 -2
index 7a9f476..0c363df 100644
@@ -591,14 +591,14 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
 	 * that will take too much.
 	 */
 	primary_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_PRIMARY);
-	if (!primary_plane) {
+	if (IS_ERR(primary_plane)) {
 		dev_err(dev, "failed to construct primary plane\n");
 		ret = PTR_ERR(primary_plane);
 		goto err;
 	}
 
 	cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR);
-	if (!cursor_plane) {
+	if (IS_ERR(cursor_plane)) {
 		dev_err(dev, "failed to construct cursor plane\n");
 		ret = PTR_ERR(cursor_plane);
 		goto err_primary;
#1 lore raw
Quoted 6 lines · Dan Carpenter

vc4_plane_init() returns an ERR_PTR on error, it doesn't return NULL. This was obviously intended because the next lines call PTR_ERR(primary_plane) already.

Fixes c8b75bca92cb ('Eric Anholt <[email protected]>')

Pulled this patch, should get it into 4.4. Thanks!