diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-07-22 15:56:15 +0200 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2016-07-22 13:51:31 -0400 |
commit | 8c6e6188703d81c2b926566009901d21a8fdb94d (patch) | |
tree | 1f702c95cf286343d4fa0c6cbdfe962dfcc137e2 /drivers/gpu | |
parent | 0bc329976bc178aacf78ca6e3de8084e8e7eb5e4 (diff) | |
download | op-kernel-dev-8c6e6188703d81c2b926566009901d21a8fdb94d.zip op-kernel-dev-8c6e6188703d81c2b926566009901d21a8fdb94d.tar.gz |
drm/etnaviv: Delete unnecessary checks before two function calls
The functions drm_gem_object_unreference_unlocked() and vunmap() perform
also input parameter validation.
Thus the tests around their calls are not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[seanpaul tweaked subject]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/9638cd74-ffc5-d9ee-a40c-9b60e860ad8b@users.sourceforge.net
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gem.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index df9bcba..356056a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -535,8 +535,7 @@ void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv, static void etnaviv_gem_shmem_release(struct etnaviv_gem_object *etnaviv_obj) { - if (etnaviv_obj->vaddr) - vunmap(etnaviv_obj->vaddr); + vunmap(etnaviv_obj->vaddr); put_pages(etnaviv_obj); } @@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev, return obj; fail: - if (obj) - drm_gem_object_unreference_unlocked(obj); - + drm_gem_object_unreference_unlocked(obj); return ERR_PTR(ret); } |