[PATCH 1/2] drm/amdgpu/debugfs: fix error code when smc register accessors are NULL

Christian König ckoenig.leichtzumerken at gmail.com
Fri Dec 8 13:24:20 UTC 2023


The second patch never made it into my inbox, but the first one is 
Reviewed-by: Christian König <christian.koenig at amd.com>.

Christian.

Am 07.12.23 um 18:39 schrieb Alex Deucher:
> Ping on this series?
>
> Alex
>
> On Mon, Nov 27, 2023 at 5:52 PM Alex Deucher <alexander.deucher at amd.com> wrote:
>> Should be -EOPNOTSUPP.
>>
>> Fixes: 5104fdf50d32 ("drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL")
>> Signed-off-by: Alex Deucher <alexander.deucher at amd.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 0e61ebdb3f3e..8d4a3ff65c18 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
>> @@ -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;
>> --
>> 2.42.0
>>



More information about the amd-gfx mailing list