summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-09-01 16:12:34 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-01 16:12:33 -0700
commite92cb7794558c41a85f4a549a31c37170860fd39 (patch)
tree821189352b9d22ab1817f6d38e06126705f00195
parentf93ed45f07691208e73d8fcfc18ebaa42166d109 (diff)
parent4f36d854e7983775e8482ccb9c6c27d96f22da7b (diff)
Merge "diag: Add protection before accessing md_session_map"
-rw-r--r--drivers/char/diag/diagchar_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c
index fa997b0ea21a..9cee52fdf870 100644
--- a/drivers/char/diag/diagchar_core.c
+++ b/drivers/char/diag/diagchar_core.c
@@ -1752,15 +1752,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;