Skip to content

Commit

Permalink
drm/cirrus: Remove unecessary NULL check in gem_free
Browse files Browse the repository at this point in the history
The ->gem_free_object never gets called with a NULL pointer, the check
is redundant. Also checking after the upcast allows compilers to elide
it anyway.

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>
  • Loading branch information
Daniel Vetter committed Apr 22, 2014
1 parent 275c632 commit 3d535ed
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/cirrus/cirrus_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ void cirrus_gem_free_object(struct drm_gem_object *obj)
{
struct cirrus_bo *cirrus_bo = gem_to_cirrus_bo(obj);

if (!cirrus_bo)
return;
cirrus_bo_unref(&cirrus_bo);
}

Expand Down

0 comments on commit 3d535ed

Please sign in to comment.