mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
dwc3-msm-core: Add NULL check against USB GSI event buffer
mdwc->gsi_ev_buff is seen NULL when dwc3_msm_notify_event() is getting called from dwc3 driver's probe context as mdwc->gsi_ev_buff is being allocated at end of dwc3_msm_core_init(). dwc3_otg_start_peripheral() setups GSI event buffers with USB controller. Fix NULL pointer issue by adding explicit check against NULL with mdwc->gsi_ev_buff. Change-Id: Ia15b677b5fa55e4281a78fb877283fe37c9ad95f Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
This commit is contained in:
parent
3912c8275c
commit
63c0cd6d2d
|
|
@ -3321,6 +3321,9 @@ void dwc3_msm_notify_event(struct dwc3 *dwc,
|
|||
break;
|
||||
case DWC3_GSI_EVT_BUF_SETUP:
|
||||
dev_dbg(mdwc->dev, "DWC3_GSI_EVT_BUF_SETUP\n");
|
||||
if (!mdwc->gsi_ev_buff)
|
||||
break;
|
||||
|
||||
for (i = 0; i < mdwc->num_gsi_event_buffers; i++) {
|
||||
evt = mdwc->gsi_ev_buff[i];
|
||||
if (!evt)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user