mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
msm: mhi_dev: Adding check for event ring
During the initialization, device waits for M0 state. Ring structures are not yet allocated at this point. While waiting if device receives a D3cold or D3hot event, device enters the sys err state. At the end of sys err handling it acceses the event ring in mhi_dev_send_multiple_tr_events API which is causing device crash. Adding check for event ring in send multiple tr events API to fail it if ring is not present. Change-Id: Iffe44107c1925e0cccb38651aa09ba1f893f1014 Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
This commit is contained in:
parent
d4f2423d74
commit
3f0d27aba2
1 changed files with 5 additions and 0 deletions
|
|
@ -466,6 +466,11 @@ static int mhi_dev_send_multiple_tr_events(struct mhi_dev *mhi, int evnt_ring,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!ring) {
|
||||
pr_err("%s(): Ring %d not present\n", __func__, evnt_ring_idx);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ctx = (union mhi_dev_ring_ctx *)&mhi->ev_ctx_cache[evnt_ring];
|
||||
|
||||
if (mhi_ring_get_state(ring) == RING_STATE_UINT) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue