OSDN Git Service

drm/amdgpu: Clear garbage data in err_data before usage
authorJiawei Gu <Jiawei.Gu@amd.com>
Thu, 6 Jan 2022 09:07:05 +0000 (17:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Jan 2022 20:44:25 +0000 (15:44 -0500)
Memory of err_data should be cleaned before usage
when there're multiple entry in ras ih.
Otherwise garbage data from last loop will be used.

Signed-off-by: Jiawei Gu <Jiawei.Gu@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index cd9e591..8906c03 100644 (file)
@@ -1592,6 +1592,7 @@ static void amdgpu_ras_interrupt_handler(struct ras_manager *obj)
                                /* Let IP handle its data, maybe we need get the output
                                 * from the callback to udpate the error type/count, etc
                                 */
+                               memset(&err_data, 0, sizeof(err_data));
                                ret = data->cb(obj->adev, &err_data, &entry);
                                /* ue will trigger an interrupt, and in that case
                                 * we need do a reset to recovery the whole system.