aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
diff options
context:
space:
mode:
authorXiang Liu <[email protected]>2025-02-28 03:11:08 +0000
committerAlex Deucher <[email protected]>2025-03-05 15:37:27 +0000
commit677ae51f4901e22517f8291a0263f794c104e167 (patch)
tree6daf7850fa79899e7c115bce20d6e24bfcf3a052 /drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
parentdrm/amdgpu: fix spelling typos in SI (diff)
downloadkernel-677ae51f4901e22517f8291a0263f794c104e167.tar.gz
kernel-677ae51f4901e22517f8291a0263f794c104e167.zip
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]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
index 15cd0a007b71..0415ed222342 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
@@ -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;
}