Skip to content

Commit

Permalink
drm/ast: 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.

v2: Fix patch subject.

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 eb649a6 commit 183c1a3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/gpu/drm/ast/ast_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ void ast_gem_free_object(struct drm_gem_object *obj)
{
struct ast_bo *ast_bo = gem_to_ast_bo(obj);

if (!ast_bo)
return;
ast_bo_unref(&ast_bo);
}

Expand Down

0 comments on commit 183c1a3

Please sign in to comment.