From 349757ce63fe388fd0003b51290a94f5b457fdcb Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Fri, 21 Apr 2017 11:18:12 -0700 Subject: [PATCH] FROMLIST: binder: remove unneeded cleanup code (from https://patchwork.kernel.org/patch/9817817/) The buffer's transaction has already been freed before binder_deferred_release. No need to do it again. Change-Id: I2451a22aee72796d7ca1fc6c1406e22a706200c5 Signed-off-by: Todd Kjos --- drivers/android/binder.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index fa2a66daa0e9..fa13ccc06aed 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3632,7 +3632,6 @@ static int binder_node_release(struct binder_node *node, int refs) static void binder_deferred_release(struct binder_proc *proc) { - struct binder_transaction *t; struct binder_context *context = proc->context; struct rb_node *n; int threads, nodes, incoming_refs, outgoing_refs, buffers, @@ -3690,14 +3689,8 @@ static void binder_deferred_release(struct binder_proc *proc) buffer = rb_entry(n, struct binder_buffer, rb_node); - t = buffer->transaction; - if (t) { - t->buffer = NULL; - buffer->transaction = NULL; - pr_err("release proc %d, transaction %d, not freed\n", - proc->pid, t->debug_id); - /*BUG();*/ - } + /* Transaction should already have been freed */ + BUG_ON(buffer->transaction); binder_free_buf(proc, buffer); buffers++; -- 2.20.1