diff options
author | Cong Ding <dinggnu@gmail.com> | 2013-01-15 21:19:49 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 10:00:37 +0400 |
commit | b5d8f05204da22ec896145729eea1f875085126b (patch) | |
tree | eb866059da699f4b8a007bc3159ea6b3fbd97125 /drivers/gpu/drm/nouveau/nouveau_fence.c | |
parent | fd69aee4271ead4bf5c759aeaf4f16ab3d63322f (diff) | |
download | linux-b5d8f05204da22ec896145729eea1f875085126b.tar.xz |
drm/nouveau: remove unnecessary null pointer check from nouveau_fence_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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_fence.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fence.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 1d049be79f74..b6b8e49ac68f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c @@ -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; |