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

Commit ed5725e9 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

drivers: rmnet_shs: Fix shs_boost_wq memleak



Previously when SSR occured a new shs_freq_wq would be allocated
if shs initialized.

This change destroys the workqueue on de-initialization so that
allocating isn't resulting in a memleak.

Change-Id: I6282890f9fd3c6c562903ff7b64b014ad2658f38
Acked-by: default avatarRaul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 4d10bfcc
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ void rmnet_shs_boost_cpus()
	if (work_pending(&boost_cpu))
		return;

	if (shs_boost_wq)
		queue_work(shs_boost_wq, &boost_cpu);
}

@@ -126,11 +127,14 @@ void rmnet_shs_reset_cpus()
	if (work_pending(&boost_cpu))
		return;

	if (shs_boost_wq)
		queue_work(shs_boost_wq, &boost_cpu);
}

int rmnet_shs_freq_init(void)
{

	if (!shs_boost_wq)
		shs_boost_wq = alloc_workqueue("shs_boost_wq", WQ_HIGHPRI, 0);

	if (!shs_boost_wq)
@@ -149,6 +153,11 @@ int rmnet_shs_freq_exit(void)
	rmnet_shs_reset_freq();
	cancel_work_sync(&boost_cpu);

	if (shs_boost_wq) {
		destroy_workqueue(shs_boost_wq);
		shs_boost_wq = NULL;
	}

	if (rmnet_shs_freq_enable)
		cpufreq_unregister_notifier(&freq_boost_nb,
					    CPUFREQ_POLICY_NOTIFIER);