From: Ben Skeggs Date: Tue, 1 Mar 2011 00:43:44 +0000 (+1000) Subject: nouveau: fix fence_ref() where fence and *ref are the same fence X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a38a4b0a8caae9be9a66f10e12ad41a1806037f;p=mesa.git nouveau: fix fence_ref() where fence and *ref are the same fence Signed-off-by: Ben Skeggs --- 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; }