msm: ipa3: Fix to avoid buffer overread

additional check to make sure there is no buffer overread.

Change-Id: I9bf66522f6a3da7c7185f387567d6773ae402b76
Acked-by: Suhas Mallesh <smallesh@qti.qualcomm.com>
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
This commit is contained in:
Michael Adisumarta 2019-11-23 10:15:54 -08:00 • committed by Gerrit - the friendly Code Review server
commit 26958d2dfc

View file

@ -3546,7 +3546,7 @@ static int ipa3_q6_set_ex_path_to_apps(void)
/* Set the exception path to AP */
for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) {
ep_idx = ipa3_get_ep_mapping(client_idx);
if (ep_idx == -1)
if (ep_idx == -1 || (ep_idx >= IPA3_MAX_NUM_PIPES))
continue;
/* disable statuses for all modem controlled prod pipes */