drm/radeon: fix an endian bug in atom table parsing
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jul 2013 14:18:52 +0000 (10:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jul 2013 18:52:47 +0000 (14:52 -0400)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_atombios.c

index fbdaff55556bc4810437b0196b2a841be86a1f77..0c3455a7399245442dfffd2f66be3177b0347ca5 100644 (file)
@@ -3638,7 +3638,7 @@ int radeon_atom_get_mclk_range_table(struct radeon_device *rdev,
                                                p += le16_to_cpu(vram_module->usModuleSize);
                                        }
                                        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);
                                        p = (u8 *)vram_module->asMemTiming;
                                        for (i = 0; i < mclk_range_table->num_entries; i++) {