aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
diff options
context:
space:
mode:
authorXiang Liu <[email protected]>2025-02-24 13:10:24 +0000
committerAlex Deucher <[email protected]>2025-02-25 16:45:12 +0000
commitce615fe328450b761eeb71c046072aeca3099f3d (patch)
tree8f86bf31a707496c92c4344909a682652f8e2482 /drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
parentdrm/amd/pm: handling of set performance level (diff)
downloadkernel-ce615fe328450b761eeb71c046072aeca3099f3d.tar.gz
kernel-ce615fe328450b761eeb71c046072aeca3099f3d.zip
drm/amdgpu: Check if CPER enabled when generating CPER
In the case of CPER disabled, generating CPER will cause kernel NULL pointer dereference without checking. 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_aca.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
index d11593cd1922..ffd4c64e123c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
@@ -392,6 +392,9 @@ static void aca_banks_generate_cper(struct amdgpu_device *adev,
struct aca_bank_node *node;
struct aca_bank *bank;
+ if (!adev->cper.enabled)
+ return;
+
if (!banks || !count) {
dev_warn(adev->dev, "fail to generate cper records\n");
return;