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

Commit 230d3eff authored by Praveen Kurapati's avatar Praveen Kurapati
Browse files

msm: ipa3: Add change to avoid negative index access



During caching of bw reg dereg, there is a chance to access
negative index values of cache. Add changes to overcome it.

Change-Id: I646aa3c35cd5a49e46334a3b09e610448779f72a
Signed-off-by: default avatarPraveen Kurapati <pkurapat@codeaurora.org>
parent 65bda98d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3535,8 +3535,9 @@ int ipa3_qmi_reg_dereg_for_bw(bool bw_reg, int bw_reg_dereg_type)
			}
			IPA_MPM_DBG("QMI BW regst success from %d",
				ipa_mpm_ctx->bw_reg_dereg_cache[
					ipa_mpm_ctx->cache_index -
					1].bw_reg_dereg_type);
					(ipa_mpm_ctx->cache_index -
					1) % IPA_MAX_BW_REG_DEREG_CACHE].
					bw_reg_dereg_type);
		} else {
			IPA_MPM_DBG("bw_change to %d no-op, teth_count = %d",
				bw_reg,
@@ -3557,8 +3558,9 @@ int ipa3_qmi_reg_dereg_for_bw(bool bw_reg, int bw_reg_dereg_type)
			}
			IPA_MPM_DBG("QMI BW De-regst success %d",
				ipa_mpm_ctx->bw_reg_dereg_cache[
					ipa_mpm_ctx->cache_index -
					1].bw_reg_dereg_type);
					(ipa_mpm_ctx->cache_index -
					1) % IPA_MAX_BW_REG_DEREG_CACHE].
					bw_reg_dereg_type);
		} else {
			IPA_MPM_DBG("bw_change to %d no-op, teth_count = %d",
				bw_reg,