drm/amdgpu: Free CPER entry after committing to ring
Subsystems (2)
PATCH 1/1 drm/amdgpu: Free CPER entry after committing to ring
Free CPER entry when it's committed to CPER ring to avoid memory leak.
Signed-off-by Xiang Liu <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +3 -0
@@ -301,6 +301,7 @@ int amdgpu_cper_generate_ue_record(struct amdgpu_device *adev,return ret;amdgpu_cper_ring_write (ring, fatal, fatal->record_length); +kfree (fatal);return 0 ; }
@@ -323,6 +324,7 @@ int amdgpu_cper_generate_bp_threshold_record(struct amdgpu_device *adev)return ret;amdgpu_cper_ring_write (ring, bp_threshold, bp_threshold->record_length); +kfree (bp_threshold);return 0 ; }
@@ -399,6 +401,7 @@ int amdgpu_cper_generate_ce_records(struct amdgpu_device *adev, }amdgpu_cper_ring_write (ring, corrected, corrected->record_length); +kfree (corrected);return 0 ; }
Signature · 1 line
2.34.1
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Hawking Zhang <[email protected]>
Regards,
Hawking
-----Original Message-----
From: Liu, Xiang(Dean) <[email protected]>
Sent: Friday, February 28, 2025 11:12
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Chai, Thomas <[email protected]>; Liu, Xiang(Dean) <[email protected]>
Subject: [PATCH] drm/amdgpu: Free CPER entry after committing to ring
Free CPER entry when it's committed to CPER ring to avoid memory leak.
Signed-off-by Xiang Liu <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c +3 -0
@@ -301,6 +301,7 @@ int amdgpu_cper_generate_ue_record(struct amdgpu_device *adev,return ret;amdgpu_cper_ring_write (ring, fatal, fatal->record_length); +kfree (fatal);return 0 ; }
@@ -323,6 +324,7 @@ int amdgpu_cper_generate_bp_threshold_record(struct amdgpu_device *adev)return ret;amdgpu_cper_ring_write (ring, bp_threshold, bp_threshold->record_length); +kfree (bp_threshold);return 0 ; }
@@ -399,6 +401,7 @@ int amdgpu_cper_generate_ce_records(struct amdgpu_device *adev, }amdgpu_cper_ring_write (ring, corrected, corrected->record_length); +kfree (corrected);return 0 ; }
--
2.34.1