msm: ipa: Fix invalid source pipe index

Source pipe index may returned invalid or
given invalid from IOCTl.

Check it for valid before sending it to Q6.

Change-Id: I9dbbc930014549ed2d0620af6872816a18b438b5
Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
This commit is contained in:
Mohammed Javid 2017-07-27 17:23:05 +05:30 committed by Gerrit - the friendly Code Review server
parent e29d253ecf
commit 0cb4f8abcd
2 changed files with 10 additions and 0 deletions

View file

@ -807,6 +807,11 @@ int ipa3_qmi_filter_notify_send(
return -EINVAL;
}
if (req->source_pipe_index == -1) {
IPAWANERR("Source pipe index invalid\n");
return -EINVAL;
}
mutex_lock(&ipa3_qmi_lock);
if (ipa3_qmi_ctx != NULL) {
/* cache the qmi_filter_request */

View file

@ -702,6 +702,11 @@ static int ipa3_wwan_add_ul_flt_rule_to_ipa(void)
/* send ipa_fltr_installed_notif_req_msg_v01 to Q6*/
req->source_pipe_index =
ipa3_get_ep_mapping(IPA_CLIENT_APPS_WAN_PROD);
if (req->source_pipe_index == IPA_EP_NOT_ALLOCATED) {
IPAWANERR("ep mapping failed\n");
retval = -EFAULT;
}
req->install_status = QMI_RESULT_SUCCESS_V01;
req->rule_id_valid = 1;
req->rule_id_len = rmnet_ipa3_ctx->num_q6_rules;