Loading drivers/platform/msm/ipa/ipa_v3/ipa_rt.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -923,6 +923,20 @@ static int __ipa_del_rt_tbl(struct ipa3_rt_tbl *entry) return 0; return 0; } } static int __ipa_rt_validate_rule_id(u16 rule_id) { if (!rule_id) return 0; if ((rule_id < ipahal_get_rule_id_hi_bit()) || (rule_id >= ((ipahal_get_rule_id_hi_bit()<<1)-1))) { IPAERR_RL("Invalid rule_id provided 0x%x\n", rule_id); return -EPERM; } return 0; } static int __ipa_rt_validate_hndls(const struct ipa_rt_rule *rule, static int __ipa_rt_validate_hndls(const struct ipa_rt_rule *rule, struct ipa3_hdr_entry **hdr, struct ipa3_hdr_entry **hdr, struct ipa3_hdr_proc_ctx_entry **proc_ctx) struct ipa3_hdr_proc_ctx_entry **proc_ctx) Loading Loading @@ -1037,6 +1051,8 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name, if (__ipa_rt_validate_hndls(rule, &hdr, &proc_ctx)) if (__ipa_rt_validate_hndls(rule, &hdr, &proc_ctx)) goto error; goto error; if (__ipa_rt_validate_rule_id(rule_id)) goto error; tbl = __ipa_add_rt_tbl(ip, name); tbl = __ipa_add_rt_tbl(ip, name); if (tbl == NULL || (tbl->cookie != IPA_RT_TBL_COOKIE)) { if (tbl == NULL || (tbl->cookie != IPA_RT_TBL_COOKIE)) { Loading Loading
drivers/platform/msm/ipa/ipa_v3/ipa_rt.c +16 −0 Original line number Original line Diff line number Diff line Loading @@ -923,6 +923,20 @@ static int __ipa_del_rt_tbl(struct ipa3_rt_tbl *entry) return 0; return 0; } } static int __ipa_rt_validate_rule_id(u16 rule_id) { if (!rule_id) return 0; if ((rule_id < ipahal_get_rule_id_hi_bit()) || (rule_id >= ((ipahal_get_rule_id_hi_bit()<<1)-1))) { IPAERR_RL("Invalid rule_id provided 0x%x\n", rule_id); return -EPERM; } return 0; } static int __ipa_rt_validate_hndls(const struct ipa_rt_rule *rule, static int __ipa_rt_validate_hndls(const struct ipa_rt_rule *rule, struct ipa3_hdr_entry **hdr, struct ipa3_hdr_entry **hdr, struct ipa3_hdr_proc_ctx_entry **proc_ctx) struct ipa3_hdr_proc_ctx_entry **proc_ctx) Loading Loading @@ -1037,6 +1051,8 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name, if (__ipa_rt_validate_hndls(rule, &hdr, &proc_ctx)) if (__ipa_rt_validate_hndls(rule, &hdr, &proc_ctx)) goto error; goto error; if (__ipa_rt_validate_rule_id(rule_id)) goto error; tbl = __ipa_add_rt_tbl(ip, name); tbl = __ipa_add_rt_tbl(ip, name); if (tbl == NULL || (tbl->cookie != IPA_RT_TBL_COOKIE)) { if (tbl == NULL || (tbl->cookie != IPA_RT_TBL_COOKIE)) { Loading