Skip to contentSkip to conversation

drm/omap: checking for NULL instead of IS_ERR()

PATCH In review Dan Carpenter 2 participants 2 messages Jul 31, 2015

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

PATCH 1/1 drm/omap: checking for NULL instead of IS_ERR()

We recently start using the new drm_fb_helper functions but the error handling needs to be updated as well to check for IS_ERR() instead of NULL.

Fixes 377eb331375f ('drm/omap: Use new drm_fb_helper functions')
drivers/gpu/drm/omapdrm/omap_fbdev.c +2 -2
index 08ef090..b8e4cde 100644
@@ -180,9 +180,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
 	mutex_lock(&dev->struct_mutex);
 
 	fbi = drm_fb_helper_alloc_fbi(helper);
-	if (!fbi) {
+	if (IS_ERR(fbi)) {
 		dev_err(dev->dev, "failed to allocate fb info\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(fbi);
 		goto fail_unlock;
 	}
 
#1 lore raw

Hi,

Quoted 12 lines · Dan Carpenter

We recently start using the new drm_fb_helper functions but the error handling needs to be updated as well to check for IS_ERR() instead of NULL.

Fixes 377eb331375f ('drm/omap: Use new drm_fb_helper functions')
drivers/gpu/drm/omapdrm/omap_fbdev.c +0 -0
index 08ef090..b8e4cde 100644

drivers/gpu/drm/omapdrm/omap_fbdev.c static int omap_fbdev_create(struct drm_fb_helper *helper, · line 187

Quoted 10 lines
drivers/gpu/drm/omapdrm/omap_fbdev.c +2 -2
@@ -180,9 +180,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
  	mutex_lock(&dev->struct_mutex);
 
  	fbi = drm_fb_helper_alloc_fbi(helper);
-	if (!fbi) {
+	if (IS_ERR(fbi)) {
  		dev_err(dev->dev, "failed to allocate fb info\n");
-		ret = -ENOMEM;
+		ret = PTR_ERR(fbi);
  		goto fail_unlock;
  	}

I was going to post out a v3 for this set. I'll squash this and mention the fix in the changelog.

Thanks,
Archit

Quoted 2 lines
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel