From: Jiawei Gu Date: Thu, 6 Jan 2022 09:07:05 +0000 (+0800) Subject: drm/amdgpu: Clear garbage data in err_data before usage X-Git-Tag: v6.1-rc5~2161^2~2^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b54ce6c92cf57ff276e4539750c140c9c96416f3;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: Clear garbage data in err_data before usage 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 Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index cd9e591..8906c03 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -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.