mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
usb: dwc3-msm: Fix out-of-bounds access in bus voting
The for loop in dwc3_msm_update_bus_bw() was using a NULL condition rather than against ARRAY_SIZE(mdwc->icc_paths). This can result in an out-of-bounds access if the memory just beyond the array also happens to be non-zero. Change-Id: Ib1f003f774b125a156ceb0070cd9d98a4d1f03ee Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
parent
154900b51b
commit
2c605b45cc
1 changed files with 1 additions and 1 deletions
|
|
@ -2737,7 +2737,7 @@ static int dwc3_msm_update_bus_bw(struct dwc3_msm *mdwc, enum bus_vote bv)
|
|||
else if (bv == BUS_VOTE_NONE)
|
||||
bv_index = BUS_VOTE_NONE;
|
||||
|
||||
for (i = 0; mdwc->icc_paths[i]; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(mdwc->icc_paths); i++) {
|
||||
ret = icc_set_bw(mdwc->icc_paths[i],
|
||||
bus_vote_values[bv_index][i].avg,
|
||||
bus_vote_values[bv_index][i].peak);
|
||||
|
|
|
|||
Loading…
Reference in a new issue