Skip to contentSkip to conversation

virtio-gpu: no point of checking res->iov

PATCH New Dongwon Kim 1 participant 1 message Aug 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-gpu: no point of checking res->iov

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.

---
 hw/display/virtio-gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/virtio-gpu.c +1 -1
index 990e71fd40..72da5bf500 100644
@@ -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;
Signature · 1 line
2.20.1