Skip to content

Commit 07e8c4b

Browse files
author
Anmolpreet Kaur
committed
smcinvoke: Move IPC_LOG before deleting cb_txn
Move IPC_LOG inside mutex lock and bfefore deleting cb_txn inside process_tzcb_req to make sure that we are not accessing cb_req value that has gone bad. Change-Id: Icc04bab52d1364d883b0a4bb07ff4cf2cc8ce6f8 Signed-off-by: Anmolpreet Kaur <[email protected]>
1 parent 11b2824 commit 07e8c4b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/soc/qcom/smcinvoke.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -1194,16 +1194,15 @@ static void process_tzcb_req(void *buf, size_t buf_len, struct file **arr_filp)
11941194
}
11951195
--cb_reqs_inflight;
11961196
memcpy(buf, cb_req, buf_len);
1197+
IPC_LOG("result=%d tzhandle=0x%08x op=0x%02x counts=0x%04x, cb_reqs_inflight=%d",
1198+
cb_req->result,
1199+
cb_req->hdr.tzhandle, cb_req->hdr.op, cb_req->hdr.counts,
1200+
cb_reqs_inflight);
11971201
kref_put(&cb_txn->ref_cnt, delete_cb_txn);
11981202
if (srvr_info)
11991203
kref_put(&srvr_info->ref_cnt, destroy_cb_server);
12001204
mutex_unlock(&g_smcinvoke_lock);
12011205

1202-
IPC_LOG("result=%d tzhandle=0x%08x op=0x%02x counts=0x%04x, cb_reqs_inflight=%d",
1203-
cb_req->result,
1204-
cb_req->hdr.tzhandle, cb_req->hdr.op, cb_req->hdr.counts,
1205-
cb_reqs_inflight);
1206-
12071206
}
12081207

12091208
static int marshal_out_invoke_req(const uint8_t *buf, uint32_t buf_size,

0 commit comments

Comments
 (0)