Commit afe58346 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/debugfs: fix error code when smc register accessors are NULL

Should be -EOPNOTSUPP.

Fixes: 5104fdf5 ("drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL")
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6872a189
......@@ -755,7 +755,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
int r;
if (!adev->smc_rreg)
return -EPERM;
return -EOPNOTSUPP;
if (size & 0x3 || *pos & 0x3)
return -EINVAL;
......@@ -814,7 +814,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
int r;
if (!adev->smc_wreg)
return -EPERM;
return -EOPNOTSUPP;
if (size & 0x3 || *pos & 0x3)
return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment