diff options
author | qctecmdr <qctecmdr@localhost> | 2019-10-02 01:21:33 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-10-02 01:21:33 -0700 |
commit | 1ab46e789d4d30f074d6ea421b2873b6f74da6f9 (patch) | |
tree | 58923f8671f32aa78cd2fcfab57a6afe421931c3 /drivers/rmnet | |
parent | 603cd845c047dd3bd53b6ac73e191351c4ce43ee (diff) | |
parent | ed5725e9c8a51f40a3866bbb3d03e277f3bfb4b5 (diff) | |
download | data-kernel-1ab46e789d4d30f074d6ea421b2873b6f74da6f9.tar.gz |
Merge "drivers: rmnet_shs: Fix shs_boost_wq memleak"
Diffstat (limited to 'drivers/rmnet')
-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); |