FROMLIST: binder: remove unneeded cleanup code
authorTodd Kjos <tkjos@google.com>
Fri, 21 Apr 2017 18:18:12 +0000 (11:18 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 26 Feb 2019 11:36:29 +0000 (11:36 +0000)
(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: I412709c23879c5e45a6c7304a588bba0a5223fc3
Signed-off-by: Todd Kjos <tkjos@google.com>
drivers/android/binder.c

index 1d0f4ecc92e9911c1066e26372913d72c95deb64..b2f29f10937403c7273e0319d4a3c9234a7daf8c 100644 (file)
@@ -3634,7 +3634,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,
@@ -3692,14 +3691,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++;