[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.2 34/60] virtio-gpu: Correct virgl_renderer_resource_get_inf
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.2 34/60] virtio-gpu: Correct virgl_renderer_resource_get_info() error check |
Date: |
Wed, 21 Feb 2024 11:20:22 +0300 |
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
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>
diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c
index d1ccdf7d06..51da0e3667 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;
diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c
index 8bb7a2c21f..9f34d0e661 100644
--- a/hw/display/virtio-gpu-virgl.c
+++ b/hw/display/virtio-gpu-virgl.c
@@ -181,7 +181,7 @@ static void virgl_cmd_set_scanout(VirtIOGPU *g,
memset(&info, 0, sizeof(info));
ret = virgl_renderer_resource_get_info(ss.resource_id, &info);
#endif
- if (ret == -1) {
+ if (ret) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: illegal resource specified %d\n",
__func__, ss.resource_id);
--
2.39.2
- [Stable-8.2.2 03/60] vfio/pci: Clear MSI-X IRQ index always, (continued)
- [Stable-8.2.2 03/60] vfio/pci: Clear MSI-X IRQ index always, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 06/60] block/blkio: Make s->mem_region_alignment be 64 bits, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 09/60] qemu-options.hx: Improve -serial option documentation, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 08/60] system/vl.c: Fix handling of '-serial none -serial something', Michael Tokarev, 2024/02/21
- [Stable-8.2.2 11/60] pci-host: designware: Limit value range of iATU viewport register, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 12/60] tcg/loongarch64: Set vector registers call clobbered, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 13/60] linux-user/aarch64: Add padding before __kernel_rt_sigreturn, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 14/60] hw/scsi/lsi53c895a: add missing decrement of reentrancy counter, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 10/60] target/arm: Reinstate "vfp" property on AArch32 CPUs, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 16/60] iotests: give tempdir an identifying name, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 34/60] virtio-gpu: Correct virgl_renderer_resource_get_info() error check,
Michael Tokarev <=
- [Stable-8.2.2 38/60] hw/i386: Fix _STA return value for ACPI0017, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 39/60] tests/acpi: Update DSDT.cxl to reflect change _STA return value., Michael Tokarev, 2024/02/21
- [Stable-8.2.2 40/60] linux-user/aarch64: Choose SYNC as the preferred MTE mode, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 21/60] hw/riscv/virt-acpi-build.c: fix leak in build_rhct(), Michael Tokarev, 2024/02/21
- [Stable-8.2.2 28/60] tcg/arm: Fix goto_tb for large translation blocks, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 27/60] tcg: Increase width of temp_subindex, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 20/60] migration: Fix logic of channels and transport compatibility check, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 23/60] configure: run plugin TCG tests again, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 29/60] vhost-user.rst: Fix vring address description, Michael Tokarev, 2024/02/21
- [Stable-8.2.2 47/60] iotests: Make 144 deterministic again, Michael Tokarev, 2024/02/21