Commit b5d8f052 authored by Cong Ding's avatar Cong Ding Committed by Ben Skeggs

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: default avatarCong Ding <dinggnu@gmail.com>
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent fd69aee4
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment