From: Dmitry Osipenko Date: Sat, 11 Nov 2023 22:42:36 +0000 (+0300) Subject: drm/virtio: Fix return value for VIRTGPU_CONTEXT_PARAM_DEBUG_NAME X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=34b98a5f7a185c19715cc98c57d7e27b4785dfdf;p=linux.git 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. Fixes: 7add80126bce ("drm/uapi: add explicit virtgpu context debug name") Signed-off-by: Dmitry Osipenko Reviewed-by: Gurchetan Singh Link: https://patchwork.freedesktop.org/patch/msgid/20231111224236.890431-1-dmitry.osipenko@collabora.com --- diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 1e2042419f957..e4f76f3155504 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -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;