clk: tegra: emc: Avoid out-of-bounds bug
Subsystems (3)
PATCH 1/1 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.
--- drivers/clk/tegra/clk-emc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/tegra/clk-emc.c +1 -1
@@ -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 ; }
Signature · 1 line
2.17.0
Stephen Boyd
maintainerQuoting Dmitry Osipenko (2018-06-05 05:12:32)
Quoted 6 lines
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 <[email protected]>
Quoted 9 lines · On Tuesday, 12 June 2018 10:46:03 MSK Stephen Boyd wrote:
Quoting Dmitry Osipenko (2018-06-05 05:12:32)
Quoted 5 lines
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 <[email protected]>Fixes tag?
This is kinda a minor fix for an issue that shouldn't happen because today AFAIK nothing on Tegra imposes the max/min clock rate constraints. There is no need to backport this patch.
Quoting Dmitry Osipenko (2018-06-05 05:12:32)
Quoted 7 lines
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 <[email protected]>---
Applied to clk-next