diff options
author | Alex Frid <afrid@nvidia.com> | 2012-01-26 00:00:07 -0800 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-02-03 05:22:06 -0800 |
commit | 80007cd1b2aa916e4228d39e332ab5b902f24097 (patch) | |
tree | b7c7642c87ec7d1a1470516240315c81ad788a8b /arch/arm | |
parent | 83c067e13d7af72eb36b6d839e3a803946326b28 (diff) |
ARM: tegra: cpufreq: Fix error handling in tegra_target()
Check error returned by cpufreq table helper API to avoid using
uninitialized table index in failed case.
Reviewed-on: http://git-master/r/77523
Change-Id: Ie47481a27397c6cafe73bfbddab0a392837ad019
Signed-off-by: Alex Frid <afrid@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/78439
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index de290ce65804..f182021aa067 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -7,7 +7,7 @@ * Colin Cross <ccross@google.com> * Based on arch/arm/plat-omap/cpu-omap.c, (C) 2005 Nokia Corporation * - * Copyright (C) 2010-2011 NVIDIA Corporation + * Copyright (C) 2010-2012 NVIDIA Corporation * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -592,14 +592,16 @@ static int tegra_target(struct cpufreq_policy *policy, mutex_lock(&tegra_cpu_lock); - cpufreq_frequency_table_target(policy, freq_table, target_freq, + ret = cpufreq_frequency_table_target(policy, freq_table, target_freq, relation, &idx); + if (ret) + goto _out; freq = freq_table[idx].frequency; target_cpu_speed[policy->cpu] = freq; ret = tegra_cpu_set_speed_cap(&new_speed); - +_out: mutex_unlock(&tegra_cpu_lock); return ret; |