summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorIgor Nabirushkin <inabirushkin@nvidia.com>2015-04-28 10:04:15 +0400
committerWinnie Hsu <whsu@nvidia.com>2015-05-29 14:28:58 -0700
commitc0854f72231631dbc278572ecb5d568053ff97a8 (patch)
treeb10ba2160faaecf6c1a27cd2b1073f38bb34cbe1 /drivers/misc
parent5edae96160793d2721ae52f30ec2d2e771e0f067 (diff)
misc: tegra-profiler: fix coverity issue
Fix Coverity issue of out-of-bounds. Coverity id: 29855 Bug 1416640 Change-Id: I112daaad55c1a2de9fdb411a0591e4ed7bf50e6e Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-on: http://git-master/r/730896 (cherry picked from commit 09c1b2add13aa7c6f4410c874ddad936913f5d19) Reviewed-on: http://git-master/r/748092 GVS: Gerrit_Virtual_Submit Reviewed-by: Andrey Trachenko <atrachenko@nvidia.com> Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/tegra-profiler/power_clk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/tegra-profiler/power_clk.c b/drivers/misc/tegra-profiler/power_clk.c
index 7af075391939..b7b198333fae 100644
--- a/drivers/misc/tegra-profiler/power_clk.c
+++ b/drivers/misc/tegra-profiler/power_clk.c
@@ -210,7 +210,7 @@ read_source(struct power_clk_source *s, int cpu)
switch (s->type) {
case QUADD_POWER_CLK_CPU:
/* update cpu frequency */
- if (cpu < 0 || cpu >= POWER_CLK_MAX_VALUES) {
+ if (cpu < 0 || cpu >= max_t(int, s->nr, nr_cpu_ids)) {
pr_err_once("error: cpu id: %d\n", cpu);
break;
}