summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Prabhu B <bmanoj@codeaurora.org>2021-04-19 10:41:01 +0530
committerMadhab Sharma <madhshar@codeaurora.org>2021-05-18 17:36:12 +0530
commit44a1037e726f9089905743fce40f10a2c9f7413d (patch)
tree4c3d5bd970ad6690fe807344295ef4ed4946a11c
parent95b4d2a89bf252bfe2bb5d2f7ba6c9ba1ff44ada (diff)
diag: Use valid data_source for a valid token
For a valid token indicating remote proc use data_source to indicate packet originated from dci remote source. Change-Id: I01729a905d532fae7ea046acc143598eca04460b Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
-rw-r--r--drivers/char/diag/diag_dci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c
index cf2e08f65b64..1fe7fa0debcc 100644
--- a/drivers/char/diag/diag_dci.c
+++ b/drivers/char/diag/diag_dci.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1061,6 +1061,11 @@ void extract_dci_pkt_rsp(unsigned char *buf, int len, int data_source,
return;
}
+ if (token != entry->client_info.token) {
+ mutex_unlock(&driver->dci_mutex);
+ return;
+ }
+
mutex_lock(&entry->buffers[data_source].buf_mutex);
rsp_buf = entry->buffers[data_source].buf_cmd;