Skip to content

Commit bd9e6f4

Browse files
committed
drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
jira LE-3201 cve CVE-2023-52817 Rebuild_History Non-Buildable kernel-rt-4.18.0-553.22.1.rt7.363.el8_10 commit-author Alex Deucher <alexander.deucher@amd.com> commit afe5834 Should be -EOPNOTSUPP. Fixes: 5104fdf ("drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL") Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit afe5834) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 49b5c7d commit bd9e6f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
590590
int r;
591591

592592
if (!adev->smc_rreg)
593-
return -EPERM;
593+
return -EOPNOTSUPP;
594594

595595
if (size & 0x3 || *pos & 0x3)
596596
return -EINVAL;
@@ -649,7 +649,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
649649
int r;
650650

651651
if (!adev->smc_wreg)
652-
return -EPERM;
652+
return -EOPNOTSUPP;
653653

654654
if (size & 0x3 || *pos & 0x3)
655655
return -EINVAL;

0 commit comments

Comments
 (0)