1 From 5fd9c581862a4874c0bdaf16231d8873832bbb99 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Sat, 28 Sep 2013 12:35:31 +0300
4 Subject: drm/radeon/dpm: off by one in si_set_mc_special_registers()
6 From: Dan Carpenter <dan.carpenter@oracle.com>
8 commit 5fd9c581862a4874c0bdaf16231d8873832bbb99 upstream.
10 These checks should be ">=" instead of ">". j is used as an offset into
11 the table->mc_reg_address[] array and that has
12 SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE (16) elements.
14 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
15 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 drivers/gpu/drm/radeon/si_dpm.c | 6 +++---
20 1 file changed, 3 insertions(+), 3 deletions(-)
22 --- a/drivers/gpu/drm/radeon/si_dpm.c
23 +++ b/drivers/gpu/drm/radeon/si_dpm.c
24 @@ -5174,7 +5174,7 @@ static int si_set_mc_special_registers(s
25 table->mc_reg_table_entry[k].mc_data[j] |= 0x100;
28 - if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
29 + if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
33 @@ -5184,7 +5184,7 @@ static int si_set_mc_special_registers(s
34 table->mc_reg_table_entry[k].mc_data[j] =
35 (table->mc_reg_table_entry[k].mc_data[i] & 0xffff0000) >> 16;
37 - if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
38 + if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
42 @@ -5197,7 +5197,7 @@ static int si_set_mc_special_registers(s
43 (temp_reg & 0xffff0000) |
44 (table->mc_reg_table_entry[k].mc_data[i] & 0x0000ffff);
46 - if (j > SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)
47 + if (j >= SMC_SISLANDS_MC_REGISTER_ARRAY_SIZE)