drm/amdgpu: fix missing endian-safe guard
authorEvan Quan <evan.quan@amd.com>
Thu, 10 Aug 2017 07:17:56 +0000 (15:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Aug 2017 18:46:20 +0000 (14:46 -0400)
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c

index 8c462b091aff6f74bdf7a64e28390a56d458b559..fd435a96481c2f1c019bd4d2303ebbb9b590adad 100644 (file)
@@ -659,7 +659,7 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
                info->version = (uint16_t)le32_to_cpu(header->header.ucode_version);
 
                if (CGS_UCODE_ID_CP_MEC == type)
-                       info->image_size = (header->jt_offset) << 2;
+                       info->image_size = le32_to_cpu(header->jt_offset) << 2;
 
                info->fw_version = amdgpu_get_firmware_version(cgs_device, type);
                info->feature_version = (uint16_t)le32_to_cpu(header->ucode_feature_version);