Skip to content

Commit afe5834

Browse files
committed
drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
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>
1 parent 6872a18 commit afe5834

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

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

757757
if (!adev->smc_rreg)
758-
return -EPERM;
758+
return -EOPNOTSUPP;
759759

760760
if (size & 0x3 || *pos & 0x3)
761761
return -EINVAL;
@@ -814,7 +814,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
814814
int r;
815815

816816
if (!adev->smc_wreg)
817-
return -EPERM;
817+
return -EOPNOTSUPP;
818818

819819
if (size & 0x3 || *pos & 0x3)
820820
return -EINVAL;

0 commit comments

Comments
 (0)