diff options
author | Igor Nabirushkin <inabirushkin@nvidia.com> | 2015-04-28 10:04:15 +0400 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2015-05-29 14:28:58 -0700 |
commit | c0854f72231631dbc278572ecb5d568053ff97a8 (patch) | |
tree | b10ba2160faaecf6c1a27cd2b1073f38bb34cbe1 | |
parent | 5edae96160793d2721ae52f30ec2d2e771e0f067 (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>
-rw-r--r-- | drivers/misc/tegra-profiler/power_clk.c | 2 |
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; } |