diff options
author | Louis Li <louli@nvidia.com> | 2014-07-11 07:55:07 +0000 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-07-16 06:39:53 -0700 |
commit | 4c369b2952fcff9d76e14d282c0a5c73b4a756c1 (patch) | |
tree | a17bd1763d758decf8a5896a0186797d7174d1ff | |
parent | 50c7686f0cd0d061ca538d4e84c30f1c044193d7 (diff) |
cpufreq: cancel work before free policy data
If __cpufreq_remove_dev is called right after handle_update is
scheduled, it will cause kernel crashes at process_one_work.
Bug 200018349
Bug 200020039
Change-Id: I7521163977881493f79f83664b3dd7db4f81f257
Signed-off-by: Louis Li <louli@nvidia.com>
Reviewed-on: http://git-master/r/437036
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 79383fc83164..0b70d28f1630 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -3,6 +3,7 @@ * * Copyright (C) 2001 Russell King * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. * * Oct 2005 - Ashok Raj <ashok.raj@intel.com> * Added handling for CPU hotplug @@ -1135,6 +1136,7 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif } #endif + cancel_work_sync(&data->update); free_cpumask_var(data->related_cpus); free_cpumask_var(data->cpus); kfree(data); |