mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
msm: acpuclock: Fix error path in multicore targets
Several acpuclock drivers have inherited the same error path bug in acpuclk_set_rate(). If an invalid cpu is passed as an argument to these functions, they should return immediately instead of jumping to the 'out' label, which attempts to unlock a mutex which has never been acquired. Change-Id: I47b9709605673a5200caf73a2f2a5086fde63efe Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
This commit is contained in:
parent
2a08aaeb92
commit
c1ce50b4cb
3 changed files with 6 additions and 12 deletions
|
@ -1235,10 +1235,8 @@ static int acpuclk_8960_set_rate(int cpu, unsigned long rate,
|
|||
unsigned long flags;
|
||||
int rc = 0;
|
||||
|
||||
if (cpu > num_possible_cpus()) {
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (cpu > num_possible_cpus())
|
||||
return -EINVAL;
|
||||
|
||||
if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG)
|
||||
mutex_lock(&driver_lock);
|
||||
|
|
|
@ -712,10 +712,8 @@ static int acpuclk_8x60_set_rate(int cpu, unsigned long rate,
|
|||
unsigned long flags;
|
||||
int rc = 0;
|
||||
|
||||
if (cpu > num_possible_cpus()) {
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (cpu > num_possible_cpus())
|
||||
return -EINVAL;
|
||||
|
||||
if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG)
|
||||
mutex_lock(&drv_state.lock);
|
||||
|
|
|
@ -385,10 +385,8 @@ static int acpuclk_krait_set_rate(int cpu, unsigned long rate,
|
|||
unsigned long flags;
|
||||
int rc = 0;
|
||||
|
||||
if (cpu > num_possible_cpus()) {
|
||||
rc = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
if (cpu > num_possible_cpus())
|
||||
return -EINVAL;
|
||||
|
||||
if (reason == SETRATE_CPUFREQ || reason == SETRATE_HOTPLUG)
|
||||
mutex_lock(&driver_lock);
|
||||
|
|
Loading…
Reference in a new issue