]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/cirrus: Remove unnecessary NULL check in bo_unref
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 5 Apr 2014 08:09:36 +0000 (10:09 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 22 Apr 2014 13:39:06 +0000 (15:39 +0200)
ttm_bo_unref unconditionally calls kref_put on it's argument, so the
thing can't be NULL without already causing Oopses.

Spotted by coverity.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/cirrus/cirrus_main.c

index 4b0170cf53fd9225f07f731766cb8fe71fb40e91..b119f66fed924931c0fb03de3dfd252e2e410f7f 100644 (file)
@@ -264,9 +264,7 @@ static void cirrus_bo_unref(struct cirrus_bo **bo)
 
        tbo = &((*bo)->bo);
        ttm_bo_unref(&tbo);
-       if (tbo == NULL)
-               *bo = NULL;
-
+       *bo = NULL;
 }
 
 void cirrus_gem_free_object(struct drm_gem_object *obj)