summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-01 10:43:44 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-03-01 14:44:43 +1000
commit3a38a4b0a8caae9be9a66f10e12ad41a1806037f (patch)
treee0297f12b4038bbea405c652ac52bf67862dcab3
parentd6bdf1f6ae6f8d06db740ad75e9151ef275755b2 (diff)
nouveau: fix fence_ref() where fence and *ref are the same fence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--src/gallium/drivers/nouveau/nouveau_fence.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.h b/src/gallium/drivers/nouveau/nouveau_fence.h
index 785fc8d2a0..680c75e99f 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.h
+++ b/src/gallium/drivers/nouveau/nouveau_fence.h
@@ -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;
}