]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
virtio-gpu: no point of checking res->iov
authorDongwon Kim <dongwon.kim@intel.com>
Mon, 30 Aug 2021 17:50:33 +0000 (10:50 -0700)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 31 Aug 2021 12:31:22 +0000 (14:31 +0200)
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

index 990e71fd40623009f39b2ef213139c1322bf6002..72da5bf5002c96403a48e80fe517a71b2916c931 100644 (file)
@@ -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,
                                         &res->iov_cnt);
-    if (ret != 0 || res->iov) {
+    if (ret != 0) {
         cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC;
         g_free(res);
         return;