summaryrefslogtreecommitdiff
path: root/src/intel_list.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-07 17:49:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-07 18:25:44 +0000
commit34fe3cbb316c36c7022735cf9b03d8b655e04434 (patch)
tree0fb4da58b15b42e9c88f52a8ab9345cea77bda26 /src/intel_list.h
parent46c79e4d59ec4f90a1fa97b24a3e7058fdbfa6ba (diff)
sna: Avoid recursive calls to kgem_retire_partials()
Whilst iterating the partial list and uploading the buffers, we need to avoid trigger a recursive call into retire should we attempt to shrink a buffer. Such a recursive call will modify the list beneath us so that we chase a stale pointer and wreak havoc with memory corruption. Reported-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47061 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_list.h')
-rw-r--r--src/intel_list.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/intel_list.h b/src/intel_list.h
index 366b9e87..cbadebf9 100644
--- a/src/intel_list.h
+++ b/src/intel_list.h
@@ -207,8 +207,9 @@ list_append(struct list *entry, struct list *head)
static inline void
__list_del(struct list *prev, struct list *next)
{
- next->prev = prev;
- prev->next = next;
+ asert(next->prev == prev->next);
+ next->prev = prev;
+ prev->next = next;
}
static inline void