drm/amdgpu: correct the memcpy size for ip discovery firmware
authorLe Ma <le.ma@amd.com>
Tue, 6 Sep 2022 07:07:53 +0000 (15:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 29 Sep 2022 13:44:02 +0000 (09:44 -0400)
Use fw->size instead of discovery_tmr_size for fallback path.

Signed-off-by: Le Ma <le.ma@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

index 9fa2a5ceb77dabb033d145a9b7b956601812b283..3993e61349141b0e58e4dd4944ea9adec90eacb6 100644 (file)
@@ -229,7 +229,7 @@ static int amdgpu_discovery_read_binary_from_file(struct amdgpu_device *adev, ui
                return r;
        }
 
-       memcpy((u8 *)binary, (u8 *)fw->data, adev->mman.discovery_tmr_size);
+       memcpy((u8 *)binary, (u8 *)fw->data, fw->size);
        release_firmware(fw);
 
        return 0;