Commit 1fa4252a authored by Alex Deucher's avatar Alex Deucher

drm/radeon: fix an endian bug in atom table parsing

Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1294d4a3
...@@ -3638,7 +3638,7 @@ int radeon_atom_get_mclk_range_table(struct radeon_device *rdev, ...@@ -3638,7 +3638,7 @@ int radeon_atom_get_mclk_range_table(struct radeon_device *rdev,
p += le16_to_cpu(vram_module->usModuleSize); p += le16_to_cpu(vram_module->usModuleSize);
} }
mclk_range_table->num_entries = (u8) mclk_range_table->num_entries = (u8)
((vram_module->usModuleSize - offsetof(ATOM_VRAM_MODULE_V4, asMemTiming)) / ((le16_to_cpu(vram_module->usModuleSize) - offsetof(ATOM_VRAM_MODULE_V4, asMemTiming)) /
mem_timing_size); mem_timing_size);
p = (u8 *)vram_module->asMemTiming; p = (u8 *)vram_module->asMemTiming;
for (i = 0; i < mclk_range_table->num_entries; i++) { for (i = 0; i < mclk_range_table->num_entries; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment