diag: Add protection before accessing md_session_map
Currently protection is missing while accessing global variable md_session_map. The patch adds protection before accessing the same. Change-Id: I165b9a7900cec20ca7970b37ca4823e2186fe27c Signed-off-by: Hardik Arya <harya@codeaurora.org>
This commit is contained in:
parent
11ee621aea
commit
4f36d854e7
1 changed files with 3 additions and 0 deletions
|
@ -1747,15 +1747,18 @@ static int diag_switch_logging(struct diag_logging_mode_param_t *param)
|
|||
|
||||
i = upd - UPD_WLAN;
|
||||
|
||||
mutex_lock(&driver->md_session_lock);
|
||||
if (driver->md_session_map[peripheral] &&
|
||||
(MD_PERIPHERAL_MASK(peripheral) &
|
||||
diag_mux->mux_mask) &&
|
||||
!driver->pd_session_clear[i]) {
|
||||
DIAG_LOG(DIAG_DEBUG_USERSPACE,
|
||||
"diag_fr: User PD is already logging onto active peripheral logging\n");
|
||||
mutex_unlock(&driver->md_session_lock);
|
||||
driver->pd_session_clear[i] = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
mutex_unlock(&driver->md_session_lock);
|
||||
peripheral_mask =
|
||||
diag_translate_mask(param->pd_mask);
|
||||
param->peripheral_mask = peripheral_mask;
|
||||
|
|
Loading…
Add table
Reference in a new issue