mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
usb: dwc3-msm: Avoid access of gsi_reg for non-GSI targets
Some targets do not have GSI feature. For such targets, gsi_reg array does not get allocated. DWC3_CONTROLLER_NOTIFY_CLEAR_DB event from gadget driver will access this unallocated memory. Fix this by putting a check for gsi_reg. Change-Id: I9903c0c6533abf3d6e689a40ea84ecbc066e10d8 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
This commit is contained in:
parent
026280fcfa
commit
3737f15cc7
1 changed files with 8 additions and 6 deletions
|
|
@ -2482,12 +2482,14 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc,
|
|||
break;
|
||||
case DWC3_CONTROLLER_NOTIFY_CLEAR_DB:
|
||||
dev_dbg(mdwc->dev, "DWC3_CONTROLLER_NOTIFY_CLEAR_DB\n");
|
||||
dwc3_msm_write_reg_field(mdwc->base,
|
||||
GSI_GENERAL_CFG_REG(mdwc->gsi_reg),
|
||||
BLOCK_GSI_WR_GO_MASK, true);
|
||||
dwc3_msm_write_reg_field(mdwc->base,
|
||||
GSI_GENERAL_CFG_REG(mdwc->gsi_reg),
|
||||
GSI_EN_MASK, 0);
|
||||
if (mdwc->gsi_reg) {
|
||||
dwc3_msm_write_reg_field(mdwc->base,
|
||||
GSI_GENERAL_CFG_REG(mdwc->gsi_reg),
|
||||
BLOCK_GSI_WR_GO_MASK, true);
|
||||
dwc3_msm_write_reg_field(mdwc->base,
|
||||
GSI_GENERAL_CFG_REG(mdwc->gsi_reg),
|
||||
GSI_EN_MASK, 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
dev_dbg(mdwc->dev, "unknown dwc3 event\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue