* [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug
@ 2018-06-05 12:12 Dmitry Osipenko
2018-06-12 7:46 ` Stephen Boyd
2018-07-09 0:13 ` Stephen Boyd
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2018-06-05 12:12 UTC (permalink / raw)
To: Peter De Schrijver, Prashant Gaikwad, Mikko Perttunen,
Michael Turquette, Stephen Boyd
Cc: linux-tegra, linux-clk, linux-kernel
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>
---
drivers/clk/tegra/clk-emc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug
2018-06-05 12:12 [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug Dmitry Osipenko
@ 2018-06-12 7:46 ` Stephen Boyd
2018-06-12 11:06 ` Dmitry Osipenko
2018-07-09 0:13 ` Stephen Boyd
1 sibling, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2018-06-12 7:46 UTC (permalink / raw)
To: Dmitry Osipenko, Michael Turquette, Mikko Perttunen,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-tegra, linux-clk, linux-kernel
Quoting Dmitry Osipenko (2018-06-05 05:12:32)
> 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>
Fixes: tag?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug
2018-06-12 7:46 ` Stephen Boyd
@ 2018-06-12 11:06 ` Dmitry Osipenko
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Osipenko @ 2018-06-12 11:06 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, Mikko Perttunen, Peter De Schrijver,
Prashant Gaikwad, linux-tegra, linux-clk, linux-kernel
On Tuesday, 12 June 2018 10:46:03 MSK Stephen Boyd wrote:
> Quoting Dmitry Osipenko (2018-06-05 05:12:32)
>
> > 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>
>
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug
2018-06-05 12:12 [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug Dmitry Osipenko
2018-06-12 7:46 ` Stephen Boyd
@ 2018-07-09 0:13 ` Stephen Boyd
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2018-07-09 0:13 UTC (permalink / raw)
To: Dmitry Osipenko, Michael Turquette, Mikko Perttunen,
Peter De Schrijver, Prashant Gaikwad
Cc: linux-tegra, linux-clk, linux-kernel
Quoting Dmitry Osipenko (2018-06-05 05:12:32)
> 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>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-09 0:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-05 12:12 [PATCH v1] clk: tegra: emc: Avoid out-of-bounds bug Dmitry Osipenko
2018-06-12 7:46 ` Stephen Boyd
2018-06-12 11:06 ` Dmitry Osipenko
2018-07-09 0:13 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox