OSDN Git Service

gpu: ion: fix kfree/list_del order
[android-x86/kernel.git] / drivers / staging / android / ion / ion.c
index b965f15..b2dcee5 100644 (file)
@@ -1342,8 +1342,8 @@ static bool ion_heap_drain_freelist(struct ion_heap *heap)
                return false;
        rt_mutex_lock(&heap->lock);
        list_for_each_entry_safe(buffer, tmp, &heap->free_list, list) {
-               _ion_buffer_destroy(buffer);
                list_del(&buffer->list);
+               _ion_buffer_destroy(buffer);
        }
        BUG_ON(!list_empty(&heap->free_list));
        rt_mutex_unlock(&heap->lock);