Skip to content

Commit

Permalink
drm/nouveau: remove unnecessary null pointer check from nouveau_fence…
Browse files Browse the repository at this point in the history
…_new

the variable chan is dereferenced in line 190, so it is no reason to check
null again in line 198.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Cong Ding authored and Ben Skeggs committed Feb 20, 2013
1 parent fd69aee commit b5d8f05
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/nouveau/nouveau_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,9 @@ nouveau_fence_new(struct nouveau_channel *chan, struct nouveau_fence **pfence)
return -ENOMEM;
kref_init(&fence->kref);

if (chan) {
ret = nouveau_fence_emit(fence, chan);
if (ret)
nouveau_fence_unref(&fence);
}
ret = nouveau_fence_emit(fence, chan);
if (ret)
nouveau_fence_unref(&fence);

*pfence = fence;
return ret;
Expand Down

0 comments on commit b5d8f05

Please sign in to comment.