[PATCH] drm/radeon: Fix ENOSYS with better fitting error codes in radeon_gem.c

Christian König christian.koenig at amd.com
Thu Jul 27 09:30:11 UTC 2023


Am 26.07.23 um 16:16 schrieb Srinivasan Shanmugam:
> Replace the error code from 'ENOSYS' to 'EOPNOTSUPP' for unimplemented
> radeon_gem_pread_ioctl & radeon_gem_pwrite_ioctl
>
> Fixes the following:
>
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else.

Mhm, it might be better to just completely remove those.

They also allow an authorized client to spam the system logs.

Christian.

>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
>   drivers/gpu/drm/radeon/radeon_gem.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
> index d0119c5f7eb3..358d19242f4b 100644
> --- a/drivers/gpu/drm/radeon/radeon_gem.c
> +++ b/drivers/gpu/drm/radeon/radeon_gem.c
> @@ -316,7 +316,7 @@ int radeon_gem_pread_ioctl(struct drm_device *dev, void *data,
>   {
>   	/* TODO: implement */
>   	DRM_ERROR("unimplemented %s\n", __func__);
> -	return -ENOSYS;
> +	return -EOPNOTSUPP;
>   }
>   
>   int radeon_gem_pwrite_ioctl(struct drm_device *dev, void *data,
> @@ -324,7 +324,7 @@ int radeon_gem_pwrite_ioctl(struct drm_device *dev, void *data,
>   {
>   	/* TODO: implement */
>   	DRM_ERROR("unimplemented %s\n", __func__);
> -	return -ENOSYS;
> +	return -EOPNOTSUPP;
>   }
>   
>   int radeon_gem_create_ioctl(struct drm_device *dev, void *data,



More information about the amd-gfx mailing list