diff options
| author | Xiang Liu <[email protected]> | 2025-02-24 13:10:24 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2025-02-25 16:45:12 +0000 |
| commit | ce615fe328450b761eeb71c046072aeca3099f3d (patch) | |
| tree | 8f86bf31a707496c92c4344909a682652f8e2482 /drivers/gpu/drm/amd/pm/amdgpu_dpm.c | |
| parent | drm/amd/pm: handling of set performance level (diff) | |
| download | kernel-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/pm/amdgpu_dpm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c index 7c4ff12269d9..81e9b443ca0a 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c @@ -716,8 +716,9 @@ int amdgpu_dpm_send_rma_reason(struct amdgpu_device *adev) ret = smu_send_rma_reason(smu); mutex_unlock(&adev->pm.mutex); - if (amdgpu_cper_generate_bp_threshold_record(adev)) - dev_warn(adev->dev, "fail to generate bad page threshold cper records\n"); + if (adev->cper.enabled) + if (amdgpu_cper_generate_bp_threshold_record(adev)) + dev_warn(adev->dev, "fail to generate bad page threshold cper records\n"); return ret; } |
