summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorManoj Prabhu B <bmanoj@codeaurora.org>2021-04-19 10:41:01 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2022-09-16 03:58:13 -0700
commit6fc2001969fec56eb463e250dbf6116bef273045 (patch)
tree1afcd91157bce52045a7246c950cf376366e1140 /drivers/char
parent5a359aba0364672acc23726dc807945ae6ce6397 (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>
Diffstat (limited to 'drivers/char')
-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;