Commit 8c6e6188 authored by Markus Elfring's avatar Markus Elfring Committed by Sean Paul

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
[seanpaul tweaked subject]
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/9638cd74-ffc5-d9ee-a40c-9b60e860ad8b@users.sourceforge.net
parent 0bc32997
...@@ -535,8 +535,7 @@ void etnaviv_gem_describe_objects(struct etnaviv_drm_private *priv, ...@@ -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) 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); put_pages(etnaviv_obj);
} }
...@@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(struct drm_device *dev, ...@@ -670,9 +669,7 @@ static struct drm_gem_object *__etnaviv_gem_new(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