diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-12-20 23:44:55 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-20 23:44:55 -0800 |
commit | 186d081d945591a89e73f9327e2bd3d5f96bf929 (patch) | |
tree | ee890f4841a12be197f58f94d9d028aacc959c84 | |
parent | 02ea5fbed297ff7cff857648edf3feee3870da07 (diff) | |
parent | 4aaf2b80989259608e8d7a09ae9d30dae7a99075 (diff) |
Merge "diag: dci: Protect the client list and command entries"
-rw-r--r-- | drivers/char/diag/diag_dci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/diag/diag_dci.c b/drivers/char/diag/diag_dci.c index f0cd6cf3967d..7af9d8184f97 100644 --- a/drivers/char/diag/diag_dci.c +++ b/drivers/char/diag/diag_dci.c @@ -1444,6 +1444,7 @@ void diag_dci_notify_client(int peripheral_mask, int data, int proc) dci_ops_tbl[proc].peripheral_status &= ~peripheral_mask; /* Notify the DCI process that the peripheral DCI Channel is up */ + mutex_lock(&driver->dci_mutex); list_for_each_safe(start, temp, &driver->dci_client_list) { entry = list_entry(start, struct diag_dci_client_tbl, track); if (entry->client_info.token != proc) @@ -1466,6 +1467,7 @@ void diag_dci_notify_client(int peripheral_mask, int data, int proc) info.si_int, stat); } } + mutex_unlock(&driver->dci_mutex); } static int diag_send_dci_pkt(struct diag_cmd_reg_t *entry, @@ -1938,6 +1940,7 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len) reg_entry.cmd_code_hi = header->subsys_cmd_code; reg_entry.cmd_code_lo = header->subsys_cmd_code; + mutex_lock(&driver->cmd_reg_mutex); temp_entry = diag_cmd_search(®_entry, ALL_PROC); if (temp_entry) { reg_item = container_of(temp_entry, struct diag_cmd_reg_t, @@ -1949,6 +1952,7 @@ static int diag_process_dci_pkt_rsp(unsigned char *buf, int len) reg_entry.cmd_code, reg_entry.subsys_id, reg_entry.cmd_code_hi); } + mutex_unlock(&driver->cmd_reg_mutex); return ret; } |