drm/virtio: Fix return value for VIRTGPU_CONTEXT_PARAM_DEBUG_NAME
Subsystems (3)
Dmitry Osipenko
maintainerPATCH 1/1 drm/virtio: Fix return value for VIRTGPU_CONTEXT_PARAM_DEBUG_NAME
The strncpy_from_user() returns number of copied bytes and not zero on success. The non-zero return value of ioctl is treated as error. Return zero on success instead of the number of copied bytes.
--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 -0
@@ -665,6 +665,7 @@ static int virtio_gpu_context_init_ioctl(struct drm_device *dev, goto out_unlock; vfpriv->explicit_debug_name = true; + ret =0 ;break ;default : ret = -EINVAL ;
Signature · 1 line
2.41.0
Quoted 7 lines · Dmitry Osipenko
The
strncpy_from_user()returns number of copied bytes and not zero on success. The non-zero return value of ioctl is treated as error. Return zero on success instead of the number of copied bytes.Fixes 7add80126bce ("drm/uapi: add explicit virtgpu context debug name")Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 22 lines
--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/virtio/virtgpu_ioctl.c +1
-0@@ -665,6 +665,7 @@ static int virtio_gpu_context_init_ioctl(structdrm_device *dev, goto out_unlock; vfpriv->explicit_debug_name = true; + ret =0 ;break ;default :ret = -EINVAL;--
2.41.0
Quoted 15 lines · Dmitry Osipenko
The
strncpy_from_user()returns number of copied bytes and not zero on success. The non-zero return value of ioctl is treated as error. Return zero on success instead of the number of copied bytes.Fixes 7add80126bce ("drm/uapi: add explicit virtgpu context debug name")Signed-off-by Dmitry Osipenko <[email protected]>--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/virtio/virtgpu_ioctl.c +0
-0
drivers/gpu/drm/virtio/virtgpu_ioctl.c static int virtio_gpu_context_init_ioctl(struct drm_device *dev, · line 671
Quoted 7 lines
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1
-0@@ -665,6 +665,7 @@ static int virtio_gpu_context_init_ioctl(struct drm_device *dev, goto out_unlock; vfpriv->explicit_debug_name = true; + ret =0 ;break ;default : ret = -EINVAL ;
Applied to misc-next
Signature · 2 lines
Best regards, Dmitry