Commit e73a8569 authored by Markus Elfring's avatar Markus Elfring Committed by Rob Clark

drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked()

The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns immediately.
Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 851dd75d
...@@ -168,7 +168,6 @@ static void mdp4_destroy(struct msm_kms *kms) ...@@ -168,7 +168,6 @@ static void mdp4_destroy(struct msm_kms *kms)
if (mdp4_kms->blank_cursor_iova) if (mdp4_kms->blank_cursor_iova)
msm_gem_put_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id); msm_gem_put_iova(mdp4_kms->blank_cursor_bo, mdp4_kms->id);
if (mdp4_kms->blank_cursor_bo)
drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo); drm_gem_object_unreference_unlocked(mdp4_kms->blank_cursor_bo);
if (mdp4_kms->rpm_enabled) if (mdp4_kms->rpm_enabled)
......
...@@ -49,7 +49,7 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb) ...@@ -49,7 +49,7 @@ static void msm_framebuffer_destroy(struct drm_framebuffer *fb)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
struct drm_gem_object *bo = msm_fb->planes[i]; struct drm_gem_object *bo = msm_fb->planes[i];
if (bo)
drm_gem_object_unreference_unlocked(bo); drm_gem_object_unreference_unlocked(bo);
} }
......
...@@ -875,8 +875,6 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, ...@@ -875,8 +875,6 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
return obj; return obj;
fail: fail:
if (obj)
drm_gem_object_unreference_unlocked(obj); drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment