From: Alex Deucher alexander.deucher@amd.com
mainline inclusion from mainline-v6.8-rc1 commit afe58346d5d3887b3e49ff623d2f2e471f232a8d category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9RE4X CVE: CVE-2023-52817
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i...
--------------------------------
Should be -EOPNOTSUPP.
Fixes: 5104fdf50d32 ("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 Signed-off-by: Ye Bin yebin10@huawei.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 6af557ecc83c..ccdd7f4b029c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -392,7 +392,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf, int r;
if (!adev->smc_wreg) - return -EPERM; + return -EOPNOTSUPP;
if (size & 0x3 || *pos & 0x3) return -EINVAL; @@ -434,7 +434,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user * int r;
if (!adev->smc_rreg) - return -EPERM; + return -EOPNOTSUPP;
if (size & 0x3 || *pos & 0x3) return -EINVAL;