drm/radeon: fix typo in radeon_atom_init_mc_reg_table()
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 1 Jul 2013 17:33:53 +0000 (13:33 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 1 Jul 2013 19:46:49 +0000 (15:46 -0400)
Bad pointer math.  Fixes hangs in state transitions with
BTC+ asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_atombios.c

index dfcf74a890146f2a1cfe7bb263007bb1db3788e5..70d8687e60e0efb220528833e222dad64ae152ba 100644 (file)
@@ -3732,7 +3732,8 @@ int radeon_atom_init_mc_reg_table(struct radeon_device *rdev,
                                                        }
                                                        num_ranges++;
                                                }
-                                               reg_data += le16_to_cpu(reg_block->usRegDataBlkSize);
+                                               reg_data = (ATOM_MEMORY_SETTING_DATA_BLOCK *)
+                                                       ((u8 *)reg_data + le16_to_cpu(reg_block->usRegDataBlkSize));
                                        }
                                        if (*(u32 *)reg_data != END_OF_REG_DATA_BLOCK)
                                                return -EINVAL;