diff options
author | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2019-10-01 13:00:32 -0700 |
---|---|---|
committer | Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> | 2019-10-01 13:06:13 -0700 |
commit | ed5725e9c8a51f40a3866bbb3d03e277f3bfb4b5 (patch) | |
tree | 19742f1bd14cf5114c07f3681d0867d2abe0486b /drivers | |
parent | 4d10bfccf039244bcc3a02c7fafacad498b4c6d3 (diff) | |
download | data-kernel-ed5725e9c8a51f40a3866bbb3d03e277f3bfb4b5.tar.gz |
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: Raul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rmnet/shs/rmnet_shs_freq.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/rmnet/shs/rmnet_shs_freq.c b/drivers/rmnet/shs/rmnet_shs_freq.c index 053c02a..0a2fd8e 100644 --- a/drivers/rmnet/shs/rmnet_shs_freq.c +++ b/drivers/rmnet/shs/rmnet_shs_freq.c @@ -106,7 +106,8 @@ void rmnet_shs_boost_cpus() if (work_pending(&boost_cpu)) return; - queue_work(shs_boost_wq, &boost_cpu); + if (shs_boost_wq) + queue_work(shs_boost_wq, &boost_cpu); } void rmnet_shs_reset_cpus() @@ -126,12 +127,15 @@ void rmnet_shs_reset_cpus() if (work_pending(&boost_cpu)) return; - queue_work(shs_boost_wq, &boost_cpu); + if (shs_boost_wq) + queue_work(shs_boost_wq, &boost_cpu); } int rmnet_shs_freq_init(void) { - shs_boost_wq = alloc_workqueue("shs_boost_wq", WQ_HIGHPRI, 0); + + if (!shs_boost_wq) + shs_boost_wq = alloc_workqueue("shs_boost_wq", WQ_HIGHPRI, 0); if (!shs_boost_wq) return -EFAULT; @@ -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); |