From 3a38a4b0a8caae9be9a66f10e12ad41a1806037f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 1 Mar 2011 10:43:44 +1000 Subject: nouveau: fix fence_ref() where fence and *ref are the same fence Signed-off-by: Ben Skeggs --- src/gallium/drivers/nouveau/nouveau_fence.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_fence.h b/src/gallium/drivers/nouveau/nouveau_fence.h index 785fc8d2a0a..680c75e99f9 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; } -- cgit v1.2.3