mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
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 <xiang.liu@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
700e535db4
commit
ce615fe328
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user