drm/msm: Delete an unnecessary check before drm_gem_object_unreference()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 13 Jul 2016 17:29:19 +0000 (19:29 +0200)
committerRob Clark <robdclark@gmail.com>
Sat, 16 Jul 2016 14:29:35 +0000 (10:29 -0400)
The drm_gem_object_unreference() function tests whether its argument
is NULL and then returns immediately.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_gem.c

index 9a713fbb2d01282ad8b3a73beea5e35e3085a0a3..6cd4af443139cbdf858a0ba24baeddb01292b785 100644 (file)
@@ -830,9 +830,7 @@ struct drm_gem_object *msm_gem_new(struct drm_device *dev,
        return obj;
 
 fail:
-       if (obj)
-               drm_gem_object_unreference(obj);
-
+       drm_gem_object_unreference(obj);
        return ERR_PTR(ret);
 }