mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
msm: mhi_dev: Fix to avoid double free in alloc_evt_buf_evt_req()
There is a possible race condition, if the client calls MHI close and channel gets a start command then mhi_dev_alloc_evt_buf_evt_req() would be called. This can lead to tr_events and ereqs getting freed from both the contexts. Fix is to use a mutex to prevent this from happening parallelly. Change-Id: I9ac10211d5bd5cee96e69b7fc10955e24569cf64 Signed-off-by: Subramanian Ananthanarayanan <skananth@codeaurora.org> Signed-off-by: Gauri Joshi <gaurjosh@codeaurora.org>
This commit is contained in:
parent
3e7d042939
commit
b3f6abccd5
1 changed files with 2 additions and 0 deletions
|
|
@ -1713,8 +1713,10 @@ static void mhi_dev_process_cmd_ring(struct mhi_dev *mhi,
|
|||
return;
|
||||
}
|
||||
}
|
||||
mutex_lock(&mhi->ch[ch_id].ch_lock);
|
||||
mhi_dev_alloc_evt_buf_evt_req(mhi, &mhi->ch[ch_id],
|
||||
evt_ring);
|
||||
mutex_unlock(&mhi->ch[ch_id].ch_lock);
|
||||
}
|
||||
|
||||
if (MHI_USE_DMA(mhi))
|
||||
|
|
|
|||
Loading…
Reference in a new issue