summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Prabhu B <bmanoj@codeaurora.org>2016-09-28 18:48:38 +0530
committerManoj Prabhu B <bmanoj@codeaurora.org>2016-11-02 19:43:35 +0530
commitf139281b60ad455a948479913c469cab40e757be (patch)
tree54608eb46bbcf2e170097c7eff4911bb5bf31e15
parentb7b9ec64a7116232e7011ac047b710367a4fa12f (diff)
diag: Fix race condition while closing SMD
This patch extends protection while closing SMD/socket while feature mask processing. CRs-Fixed: 1059771 Change-Id: Icdf27dce5b3eb7cfc4a7686f044195db13a81a58 Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
-rw-r--r--drivers/char/diag/diagfwd_peripheral.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/char/diag/diagfwd_peripheral.c b/drivers/char/diag/diagfwd_peripheral.c
index 731b42c56998..40fdcbaaf31a 100644
--- a/drivers/char/diag/diagfwd_peripheral.c
+++ b/drivers/char/diag/diagfwd_peripheral.c
@@ -651,13 +651,12 @@ void diagfwd_close_transport(uint8_t transport, uint8_t peripheral)
break;
default:
return;
-
}
+ mutex_lock(&driver->diagfwd_channel_mutex);
fwd_info = &early_init_info[transport][peripheral];
if (fwd_info->p_ops && fwd_info->p_ops->close)
fwd_info->p_ops->close(fwd_info->ctxt);
- mutex_lock(&driver->diagfwd_channel_mutex);
fwd_info = &early_init_info[transport_open][peripheral];
dest_info = &peripheral_info[TYPE_CNTL][peripheral];
dest_info->inited = 1;