diff mbox series

[PULL,1/6] virtio-gpu: no point of checking res->iov

Message ID 20210901041903.3111086-2-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,1/6] virtio-gpu: no point of checking res->iov | expand

Commit Message

Gerd Hoffmann Sept. 1, 2021, 4:18 a.m. UTC
From: Dongwon Kim <dongwon.kim@intel.com>

The code should check the opposite condition of res->iov because it will be null
if virtio_gpu_create_mapping_iov fails and actually this checking is not even
required because checking on ret covers all failing cases.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20210830175033.29233-1-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
 hw/display/virtio-gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 990e71fd4062..72da5bf5002c 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -362,7 +362,7 @@  static void virtio_gpu_resource_create_blob(VirtIOGPU *g,
     ret = virtio_gpu_create_mapping_iov(g, cblob.nr_entries, sizeof(cblob),
                                         cmd, &res->addrs, &res->iov,
-    if (ret != 0 || res->iov) {
+    if (ret != 0) {
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;