OSDN Git Service

msm-core: Move get_user out side critical section
authorMaulik Shah <mkshah@codeaurora.org>
Tue, 28 Jun 2016 11:26:54 +0000 (16:56 +0530)
committerKyle Yan <kyan@codeaurora.org>
Tue, 5 Jul 2016 22:36:22 +0000 (15:36 -0700)
get_user is not needed inside critical section. Move
it outside to avoid kernel crash due to sleeping
function called from invalid context.

Change-Id: I29a54dca6620dc75356067ce6ff9a0931b4d0724
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
drivers/power/qcom/msm-core.c

index 49ed2eb..e990425 100644 (file)
@@ -428,8 +428,8 @@ static int update_userspace_power(struct sched_params __user *argp)
        /* Copy the same power values for all the cpus in the cpumask
         * argp->cpumask within the cluster (argp->cluster)
         */
-       spin_lock(&update_lock);
        get_user(cpumask, &argp->cpumask);
+       spin_lock(&update_lock);
        for (i = 0; i < MAX_CORES_PER_CLUSTER; i++, cpumask >>= 1) {
                if (!(cpumask & 0x01))
                        continue;