mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
Merge "ion: fix race condition in ion driver [1/1]" into odroidg12-4.9.y-android
This commit is contained in:
@@ -1319,6 +1319,7 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
|
||||
size_t total_size = 0;
|
||||
size_t total_orphaned_size = 0;
|
||||
#ifdef CONFIG_AMLOGIC_MODIFY
|
||||
mutex_lock(&debugfs_mutex);
|
||||
mutex_lock(&dev->buffer_lock);
|
||||
seq_puts(s, "All allocated buffers listed:\n");
|
||||
for (n = rb_first(&dev->buffers); n; n = rb_next(n)) {
|
||||
@@ -1338,8 +1339,8 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
|
||||
#else
|
||||
seq_printf(s, "%16s %16s %16s\n", "client", "pid", "size");
|
||||
seq_puts(s, "----------------------------------------------------\n");
|
||||
#endif
|
||||
mutex_lock(&debugfs_mutex);
|
||||
#endif
|
||||
for (n = rb_first(&dev->clients); n; n = rb_next(n)) {
|
||||
struct ion_client *client = rb_entry(n, struct ion_client,
|
||||
node);
|
||||
@@ -1358,7 +1359,6 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
|
||||
}
|
||||
ion_debug_heap_total(client, heap->id, s);
|
||||
}
|
||||
mutex_unlock(&debugfs_mutex);
|
||||
#else
|
||||
size_t size = ion_debug_heap_total(client, heap->id);
|
||||
|
||||
@@ -1396,6 +1396,9 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
|
||||
}
|
||||
}
|
||||
mutex_unlock(&dev->buffer_lock);
|
||||
#ifdef CONFIG_AMLOGIC_MODIFY
|
||||
mutex_unlock(&debugfs_mutex);
|
||||
#endif
|
||||
seq_puts(s, "----------------------------------------------------\n");
|
||||
seq_printf(s, "%16s %16zu\n", "total orphaned",
|
||||
total_orphaned_size);
|
||||
|
||||
Reference in New Issue
Block a user