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

Commit 924af8a7 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: add lock for num_q6_rule" into LA.BR.1.2.9.1_1

parents 412e860d 8b49602c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -374,12 +374,15 @@ int copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01
{
	int rc = 0, i, j;

	/* prevent multi-threads accessing num_q6_rule */
	mutex_lock(&add_mux_channel_lock);
	if (rule_req->filter_spec_list_valid == true) {
		num_q6_rule = rule_req->filter_spec_list_len;
		IPAWANDBG("Received (%d) install_flt_req\n", num_q6_rule);
	} else {
		num_q6_rule = 0;
		IPAWANERR("got no UL rules from modem\n");
		mutex_unlock(&add_mux_channel_lock);
		return -EINVAL;
	}
	/* copy UL filter rules from Modem*/
@@ -523,6 +526,7 @@ int copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01
			rule_req->filter_spec_list[i].filter_rule.
			ipv4_frag_eq_present;
	}
	mutex_unlock(&add_mux_channel_lock);
	return rc;
}

@@ -1301,8 +1305,11 @@ static int ipa_wwan_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				IPAWANERR("failed to config egress endpoint\n");

			if (num_q6_rule != 0) {
				/* protect num_q6_rule */
				mutex_lock(&add_mux_channel_lock);
				/* already got Q6 UL filter rules*/
				rc = wwan_add_ul_flt_rule_to_ipa();
				mutex_unlock(&add_mux_channel_lock);
				egress_set = true;
				if (rc)
					IPAWANERR("install UL rules failed\n");