All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu:drm:radeon:fix array out fo bouds
@ 2016-05-16  4:58 Heloise NH
  2016-05-16 14:34   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Heloise NH @ 2016-05-16  4:58 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, airlied; +Cc: dri-devel, linux-kernel, os

From: tom will <os@iscas.ac.cn>

When the initial value of i is greater than zero,
it may cause endless loop, resulting in array out
of bouds, fix it.

Signed-off-by: tom will <os@iscas.ac.cn>
---
 drivers/gpu/drm/radeon/kv_dpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
index d024074..a7e9786 100644
--- a/drivers/gpu/drm/radeon/kv_dpm.c
+++ b/drivers/gpu/drm/radeon/kv_dpm.c
@@ -2164,7 +2164,7 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev,
 	if (pi->caps_stable_p_state) {
 		stable_p_state_sclk = (max_limits->sclk * 75) / 100;
 
-		for (i = table->count - 1; i >= 0; i++) {
+		for (i = table->count - 1; i >= 0; i--) {
 			if (stable_p_state_sclk >= table->entries[i].clk) {
 				stable_p_state_sclk = table->entries[i].clk;
 				break;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu:drm:radeon:fix array out fo bouds
  2016-05-16  4:58 [PATCH] gpu:drm:radeon:fix array out fo bouds Heloise NH
@ 2016-05-16 14:34   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2016-05-16 14:34 UTC (permalink / raw)
  To: Heloise NH
  Cc: Deucher, Alexander, Christian Koenig, Dave Airlie, LKML,
	Maling list - DRI developers

On Mon, May 16, 2016 at 12:58 AM, Heloise NH <os@iscas.ac.cn> wrote:
> From: tom will <os@iscas.ac.cn>
>
> When the initial value of i is greater than zero,
> it may cause endless loop, resulting in array out
> of bouds, fix it.
>
> Signed-off-by: tom will <os@iscas.ac.cn>

Applied to both radeon and amgpu.

Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/kv_dpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
> index d024074..a7e9786 100644
> --- a/drivers/gpu/drm/radeon/kv_dpm.c
> +++ b/drivers/gpu/drm/radeon/kv_dpm.c
> @@ -2164,7 +2164,7 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev,
>         if (pi->caps_stable_p_state) {
>                 stable_p_state_sclk = (max_limits->sclk * 75) / 100;
>
> -               for (i = table->count - 1; i >= 0; i++) {
> +               for (i = table->count - 1; i >= 0; i--) {
>                         if (stable_p_state_sclk >= table->entries[i].clk) {
>                                 stable_p_state_sclk = table->entries[i].clk;
>                                 break;
> --
> 2.1.0
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpu:drm:radeon:fix array out fo bouds
@ 2016-05-16 14:34   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2016-05-16 14:34 UTC (permalink / raw)
  To: Heloise NH
  Cc: Deucher, Alexander, Christian Koenig, Maling list - DRI developers, LKML

On Mon, May 16, 2016 at 12:58 AM, Heloise NH <os@iscas.ac.cn> wrote:
> From: tom will <os@iscas.ac.cn>
>
> When the initial value of i is greater than zero,
> it may cause endless loop, resulting in array out
> of bouds, fix it.
>
> Signed-off-by: tom will <os@iscas.ac.cn>

Applied to both radeon and amgpu.

Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/kv_dpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c
> index d024074..a7e9786 100644
> --- a/drivers/gpu/drm/radeon/kv_dpm.c
> +++ b/drivers/gpu/drm/radeon/kv_dpm.c
> @@ -2164,7 +2164,7 @@ static void kv_apply_state_adjust_rules(struct radeon_device *rdev,
>         if (pi->caps_stable_p_state) {
>                 stable_p_state_sclk = (max_limits->sclk * 75) / 100;
>
> -               for (i = table->count - 1; i >= 0; i++) {
> +               for (i = table->count - 1; i >= 0; i--) {
>                         if (stable_p_state_sclk >= table->entries[i].clk) {
>                                 stable_p_state_sclk = table->entries[i].clk;
>                                 break;
> --
> 2.1.0
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-16 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16  4:58 [PATCH] gpu:drm:radeon:fix array out fo bouds Heloise NH
2016-05-16 14:34 ` Alex Deucher
2016-05-16 14:34   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.