diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2018-06-05 15:12:32 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-07-09 03:10:19 +0300 |
commit | 405fcacbd866cfe75733b94bacdef5bcb4aa6c6c (patch) | |
tree | 7593948fa80cf224b791e13fae273c0c6ed81084 | |
parent | ce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff) | |
download | linux-405fcacbd866cfe75733b94bacdef5bcb4aa6c6c.tar.xz |
clk: tegra: emc: Avoid out-of-bounds bug
Apparently there was an attempt to avoid out-of-bounds accesses when there
is only one memory timing available, but there is a typo in the code that
neglects that attempt.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r-- | drivers/clk/tegra/clk-emc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/tegra/clk-emc.c b/drivers/clk/tegra/clk-emc.c index 5234acd30e89..0621a3a82ea6 100644 --- a/drivers/clk/tegra/clk-emc.c +++ b/drivers/clk/tegra/clk-emc.c @@ -132,7 +132,7 @@ static int emc_determine_rate(struct clk_hw *hw, struct clk_rate_request *req) timing = tegra->timings + i; if (timing->rate > req->max_rate) { - i = min(i, 1); + i = max(i, 1); req->rate = tegra->timings[i - 1].rate; return 0; } |