aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/android/binder.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/android/binder.c')
-rw-r--r--drivers/android/binder.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index cb30a524d16d..9f1000d2a40c 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2974,7 +2974,6 @@ static void binder_transaction(struct binder_proc *proc,
2974 t->buffer = NULL; 2974 t->buffer = NULL;
2975 goto err_binder_alloc_buf_failed; 2975 goto err_binder_alloc_buf_failed;
2976 } 2976 }
2977 t->buffer->allow_user_free = 0;
2978 t->buffer->debug_id = t->debug_id; 2977 t->buffer->debug_id = t->debug_id;
2979 t->buffer->transaction = t; 2978 t->buffer->transaction = t;
2980 t->buffer->target_node = target_node; 2979 t->buffer->target_node = target_node;
@@ -3510,14 +3509,18 @@ static int binder_thread_write(struct binder_proc *proc,
3510 3509
3511 buffer = binder_alloc_prepare_to_free(&proc->alloc, 3510 buffer = binder_alloc_prepare_to_free(&proc->alloc,
3512 data_ptr); 3511 data_ptr);
3513 if (buffer == NULL) { 3512 if (IS_ERR_OR_NULL(buffer)) {
3514 binder_user_error("%d:%d BC_FREE_BUFFER u%016llx no match\n", 3513 if (PTR_ERR(buffer) == -EPERM) {
3515 proc->pid, thread->pid, (u64)data_ptr); 3514 binder_user_error(
3516 break; 3515 "%d:%d BC_FREE_BUFFER u%016llx matched unreturned or currently freeing buffer\n",
3517 } 3516 proc->pid, thread->pid,
3518 if (!buffer->allow_user_free) { 3517 (u64)data_ptr);
3519 binder_user_error("%d:%d BC_FREE_BUFFER u%016llx matched unreturned buffer\n", 3518 } else {
3520 proc->pid, thread->pid, (u64)data_ptr); 3519 binder_user_error(
3520 "%d:%d BC_FREE_BUFFER u%016llx no match\n",
3521 proc->pid, thread->pid,
3522 (u64)data_ptr);
3523 }
3521 break; 3524 break;
3522 } 3525 }
3523 binder_debug(BINDER_DEBUG_FREE_BUFFER, 3526 binder_debug(BINDER_DEBUG_FREE_BUFFER,