[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211203205041.115331-1-amhamza.mgc@gmail.com>
Date: Sat, 4 Dec 2021 01:50:41 +0500
From: Ameer Hamza <amhamza.mgc@...il.com>
To: gregkh@...uxfoundation.org, arve@...roid.com, tkjos@...roid.com,
maco@...roid.com, joel@...lfernandes.org, christian@...uner.io,
hridya@...gle.com, surenb@...gle.com
Cc: linux-kernel@...r.kernel.org, amhamza.mgc@...il.com
Subject: [PATCH] binder: fixed coverity warning by moving pr_warn outside lock
Coverity warns about using print operations within a lock due to
unlikely possible deadlock scenario, however, this warning can be
easily avoided here without having any effect on the program flow.
Addresses-Coverity: 1494148 ("Thread deadlock")
Signed-off-by: Ameer Hamza <amhamza.mgc@...il.com>
---
drivers/android/binder.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index cffbe57a8e08..8ee942eef51d 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -1507,14 +1507,14 @@ static void binder_free_transaction(struct binder_transaction *t)
if (target_proc) {
binder_inner_proc_lock(target_proc);
target_proc->outstanding_txns--;
- if (target_proc->outstanding_txns < 0)
- pr_warn("%s: Unexpected outstanding_txns %d\n",
- __func__, target_proc->outstanding_txns);
if (!target_proc->outstanding_txns && target_proc->is_frozen)
wake_up_interruptible_all(&target_proc->freeze_wait);
if (t->buffer)
t->buffer->transaction = NULL;
binder_inner_proc_unlock(target_proc);
+ if (target_proc->outstanding_txns < 0)
+ pr_warn("%s: Unexpected outstanding_txns %d\n",
+ __func__, target_proc->outstanding_txns);
}
if (trace_binder_txn_latency_free_enabled())
binder_txn_latency_free(t);
--
2.25.1
Powered by blists - more mailing lists