summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdmond Chung <edmondchung@google.com>2023-06-07 09:56:12 -0700
committerEdmond Chung <edmondchung@google.com>2023-06-07 09:56:12 -0700
commit2dafbaa62508064b8b8ac6fab46bf1bbc4bfad56 (patch)
treea6136292517aafd108d34ddbb29763e92085387d
parent6a9579a0c6afc9b9311660527b610727a7f8877f (diff)
downloadlwis-2dafbaa62508064b8b8ac6fab46bf1bbc4bfad56.tar.gz
Transaction: Fix potential nullptr dereference
This should be rare, but if the process tranasction loop was skipped, then the entry pointer could be NULL. Bug: 286242704 Test: Build Change-Id: I043c54e60707f1ae1863881322706979bd9a9e07 Signed-off-by: Edmond Chung <edmondchung@google.com>
-rw-r--r--lwis_transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lwis_transaction.c b/lwis_transaction.c
index 816cbdb..26fd10b 100644
--- a/lwis_transaction.c
+++ b/lwis_transaction.c
@@ -392,7 +392,7 @@ static int process_transaction(struct lwis_client *client, struct lwis_transacti
(void *)resp, resp_size);
} else {
/* No pending events indicates it's cleanup io_entries. */
- if (resp->error_code) {
+ if (entry && resp->error_code) {
dev_err(lwis_dev->dev,
"Clean-up fails with error code %d, transaction %llu, io_entries[%d], entry_type %d",
resp->error_code, transaction->info.id, i, entry->type);