nouveau: use saved fence pointer, not head of unsignalled list
authorBen Skeggs <skeggsb@gmail.com>
Fri, 21 Mar 2008 07:15:58 +0000 (18:15 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 21 Mar 2008 07:17:12 +0000 (18:17 +1100)
It's possible for the unsignalled list head to change during fence_flush.
Fixes valgrind complaint exposed by a previous commit.

src/gallium/winsys/dri/nouveau/nouveau_fence.c

index 7714e6f2485a6ce1884e0e82f0ba5a4e608a9271..e7b0b4ff079f59ab4e0abe7531b5eae76a8200df 100644 (file)
@@ -172,14 +172,13 @@ nouveau_fence_flush(struct nouveau_channel *chan)
                nvfence = nouveau_fence(nvchan->fence_head);
                if (nvfence->sequence > sequence)
                        break;
-
                nouveau_fence_del_unsignalled(&nvfence->base);
                nvfence->signalled = 1;
 
                if (nvfence->signal_cb) {
                        struct nouveau_fence *fence = NULL;
 
-                       nouveau_fence_ref(nvchan->fence_head, &fence);
+                       nouveau_fence_ref(&nvfence->base, &fence);
 
                        while (nvfence->signal_cb) {
                                struct nouveau_fence_cb *cb;