Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a490661 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: dwc3-msm: Add explicit out-of-bounds check before array access"

parents 461f66a4 182eba5d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ static int dbm_get_num_of_eps_configured(struct dwc3_msm *mdwc)
	int i;
	int count = 0;

	for (i = 0; i < mdwc->dbm_num_eps; i++)
	for (i = 0; i < min(mdwc->dbm_num_eps, DBM_1_5_NUM_EP); i++)
		if (mdwc->dbm_ep_num_mapping[i])
			count++;

@@ -2773,9 +2773,9 @@ static int dwc3_msm_update_bus_bw(struct dwc3_msm *mdwc, enum bus_vote bv)
	 * set it to _NONE irrespective of the requested vote
	 * from userspace.
	 */
	if (bv >= BUS_VOTE_MAX)
		bv_index = mdwc->default_bus_vote;
	else if (bv == BUS_VOTE_NONE)
	if (bv_index >= BUS_VOTE_MAX)
		bv_index = BUS_VOTE_MAX - 1;
	else if (bv_index < BUS_VOTE_NONE)
		bv_index = BUS_VOTE_NONE;

	for (i = 0; i < ARRAY_SIZE(mdwc->icc_paths); i++) {