drm/nouveau: remove unnecessary null pointer check from nouveau_fence_new
authorCong Ding <dinggnu@gmail.com>
Tue, 15 Jan 2013 17:19:49 +0000 (18:19 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 20 Feb 2013 06:00:37 +0000 (16:00 +1000)
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>
drivers/gpu/drm/nouveau/nouveau_fence.c

index 1d049be..b6b8e49 100644 (file)
@@ -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;