<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 11, 2023 at 2:43 PM Dmitry Osipenko <<a href="mailto:dmitry.osipenko@collabora.com">dmitry.osipenko@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The strncpy_from_user() returns number of copied bytes and not zero on<br>
success. The non-zero return value of ioctl is treated as error. Return<br>
zero on success instead of the number of copied bytes.<br>
<br>
Fixes: 7add80126bce ("drm/uapi: add explicit virtgpu context debug name")<br>
Signed-off-by: Dmitry Osipenko <<a href="mailto:dmitry.osipenko@collabora.com" target="_blank">dmitry.osipenko@collabora.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c<br>
index 1e2042419f95..e4f76f315550 100644<br>
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c<br>
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c<br>
@@ -665,6 +665,7 @@ static int virtio_gpu_context_init_ioctl(struct drm_device *dev,<br>
goto out_unlock;<br>
<br>
vfpriv->explicit_debug_name = true;<br>
+ ret = 0;<br>
break;<br>
default:<br>
ret = -EINVAL;<br>
-- <br>
2.41.0<br>
<br>
</blockquote></div></div>