diff options
author | Dmitry Osipenko <dmitry.osipenko@collabora.com> | 2024-01-29 10:39:21 +0300 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-02-14 21:44:10 +0300 |
commit | 1c38c8a24a9d053d42e3892fddf18421cf3a67d3 (patch) | |
tree | feea16aaf3497c2b5b88b78abaf21d39659ecd93 /contrib | |
parent | bbe51d6ea3a9adcca3b46ce8f19b9b4ead488e28 (diff) | |
download | qemu-1c38c8a24a9d053d42e3892fddf18421cf3a67d3.zip qemu-1c38c8a24a9d053d42e3892fddf18421cf3a67d3.tar.gz qemu-1c38c8a24a9d053d42e3892fddf18421cf3a67d3.tar.bz2 |
virtio-gpu: Correct virgl_renderer_resource_get_info() error check
virgl_renderer_resource_get_info() returns errno and not -1 on error.
Correct the return-value check.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Message-Id: <20240129073921.446869-1-dmitry.osipenko@collabora.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 574b64aa6754ba491f51024c5a823a674d48a658)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/vhost-user-gpu/virgl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c index d1ccdf7..51da0e3 100644 --- a/contrib/vhost-user-gpu/virgl.c +++ b/contrib/vhost-user-gpu/virgl.c @@ -327,7 +327,7 @@ virgl_get_resource_info_modifiers(uint32_t resource_id, #ifdef VIRGL_RENDERER_RESOURCE_INFO_EXT_VERSION struct virgl_renderer_resource_info_ext info_ext; ret = virgl_renderer_resource_get_info_ext(resource_id, &info_ext); - if (ret < 0) { + if (ret) { return ret; } @@ -335,7 +335,7 @@ virgl_get_resource_info_modifiers(uint32_t resource_id, *modifiers = info_ext.modifiers; #else ret = virgl_renderer_resource_get_info(resource_id, info); - if (ret < 0) { + if (ret) { return ret; } @@ -372,7 +372,7 @@ virgl_cmd_set_scanout(VuGpu *g, uint64_t modifiers = 0; ret = virgl_get_resource_info_modifiers(ss.resource_id, &info, &modifiers); - if (ret == -1) { + if (ret) { g_critical("%s: illegal resource specified %d\n", __func__, ss.resource_id); cmd->error = VIRTIO_GPU_RESP_ERR_INVALID_RESOURCE_ID; |