summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaulik Shah <mkshah@codeaurora.org>2017-04-06 15:41:07 +0530
committerMaulik Shah <mkshah@codeaurora.org>2017-04-06 16:51:48 +0530
commitea093498dd23ca584466ff5b9802996451996323 (patch)
treedf8d7d50a5f6337d3277054eeefdbbb74fd1d6c3
parent44f5f07cfca714fa0d1b68a8f3d0f87d80a62074 (diff)
msm-core: Fix uninitialized sampling work
Sampling work can be accessed by do_sampling kthread before init. Fix this by initializing sampling work before using. Change-Id: I790ce50fcddbcd08861e31fea9bde839d6fbb7cc Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
-rw-r--r--drivers/power/qcom/msm-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/qcom/msm-core.c b/drivers/power/qcom/msm-core.c
index 3ac4611da9bd..43ad33ea234b 100644
--- a/drivers/power/qcom/msm-core.c
+++ b/drivers/power/qcom/msm-core.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1069,6 +1069,7 @@ static int msm_core_dev_probe(struct platform_device *pdev)
if (ret)
goto failed;
+ INIT_DEFERRABLE_WORK(&sampling_work, samplequeue_handle);
ret = msm_core_task_init(&pdev->dev);
if (ret)
goto failed;
@@ -1076,7 +1077,6 @@ static int msm_core_dev_probe(struct platform_device *pdev)
for_each_possible_cpu(cpu)
set_threshold(&activity[cpu]);
- INIT_DEFERRABLE_WORK(&sampling_work, samplequeue_handle);
schedule_delayed_work(&sampling_work, msecs_to_jiffies(0));
cpufreq_register_notifier(&cpu_policy, CPUFREQ_POLICY_NOTIFIER);
pm_notifier(system_suspend_handler, 0);