Merge "mhi: core: Add checks for bhie offsets"

This commit is contained in:
qctecmdr 2020-09-19 09:09:14 -07:00 • committed by Gerrit - the friendly Code Review server
commit 8c0cae110c

View file

@ -1796,6 +1796,13 @@ int mhi_prepare_for_power_up(struct mhi_controller *mhi_cntrl)
goto bhie_error;
}
if (bhie_off >= mhi_cntrl->len) {
MHI_ERR("Invalid BHIE=0x%x len=0x%x\n",
bhie_off, mhi_cntrl->len);
ret = -EINVAL;
goto bhie_error;
}
mhi_cntrl->bhie = mhi_cntrl->regs + bhie_off;
}