nouveau: fix fence_ref() where fence and *ref are the same fence

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Ben Skeggs 2011-03-01 10:43:44 +10:00
parent d6bdf1f6ae
commit 3a38a4b0a8

View file

@ -39,12 +39,13 @@ boolean nouveau_fence_signalled(struct nouveau_fence *);
static INLINE void
nouveau_fence_ref(struct nouveau_fence *fence, struct nouveau_fence **ref)
{
if (fence)
++fence->ref;
if (*ref) {
if (--(*ref)->ref == 0)
nouveau_fence_del(*ref);
}
if (fence)
++fence->ref;
*ref = fence;
}