gpu: ion: fix kfree/list_del order
With CONFIG_SLUB_DEBUG_ON it would panic during ion_alloc() ion_buffer_create() io_heap_drain_freelist() Signed-off-by: JP Abgrall <jpa@google.com> [jstultz: modified patch to apply to staging directory] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fe2faea700
commit
e09539a042
1 changed files with 1 additions and 1 deletions
|
@ -1342,8 +1342,8 @@ static bool ion_heap_drain_freelist(struct ion_heap *heap)
|
||||||
return false;
|
return false;
|
||||||
rt_mutex_lock(&heap->lock);
|
rt_mutex_lock(&heap->lock);
|
||||||
list_for_each_entry_safe(buffer, tmp, &heap->free_list, list) {
|
list_for_each_entry_safe(buffer, tmp, &heap->free_list, list) {
|
||||||
_ion_buffer_destroy(buffer);
|
|
||||||
list_del(&buffer->list);
|
list_del(&buffer->list);
|
||||||
|
_ion_buffer_destroy(buffer);
|
||||||
}
|
}
|
||||||
BUG_ON(!list_empty(&heap->free_list));
|
BUG_ON(!list_empty(&heap->free_list));
|
||||||
rt_mutex_unlock(&heap->lock);
|
rt_mutex_unlock(&heap->lock);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue