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

Commit 9cbf9519 authored by Ravi Gummadidala's avatar Ravi Gummadidala
Browse files

msm: ipa: handle IPA RM timer destruction correctly



Previously, the operation did not account for the fact
that the timer could be active i.e. on one of the timer
lists pending expiry. Later when timer expired, the timer
context was invalid leading to a crash.

Change-Id: Ic39abcabc3d34f96156e2dea36c3b0a77b4846dd
Signed-off-by: default avatarRavi Gummadidala <rgummadi@codeaurora.org>
parent cb167fec
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -138,6 +138,7 @@ int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
*/
*/
int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
{
{
	unsigned long flags;
	IPADBG("%s: resource %d\n", __func__, resource_name);
	IPADBG("%s: resource %d\n", __func__, resource_name);


	if (resource_name < 0 ||
	if (resource_name < 0 ||
@@ -152,6 +153,10 @@ int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name)
		return -EINVAL;
		return -EINVAL;
	}
	}


	spin_lock_irqsave(&ipa_rm_it_handles[resource_name].lock, flags);
	cancel_delayed_work(&ipa_rm_it_handles[resource_name].work);
	spin_unlock_irqrestore(&ipa_rm_it_handles[resource_name].lock, flags);

	memset(&ipa_rm_it_handles[resource_name], 0,
	memset(&ipa_rm_it_handles[resource_name], 0,
	       sizeof(struct ipa_rm_it_private));
	       sizeof(struct ipa_rm_it_private));