From: Cong Ding Date: Tue, 15 Jan 2013 17:19:49 +0000 (+0100) Subject: drm/nouveau: remove unnecessary null pointer check from nouveau_fence_new X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b5d8f05204da22ec896145729eea1f875085126b;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- 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;