From: Dongwon Kim Date: Mon, 30 Aug 2021 17:50:33 +0000 (-0700) Subject: virtio-gpu: no point of checking res->iov X-Git-Tag: v6.2.0-rc0~126^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc4d3f35f81a5d392d979607818cf1cb56bfbaf7;p=thirdparty%2Fqemu.git 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. Signed-off-by: Dongwon Kim Message-Id: <20210830175033.29233-1-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann --- diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 990e71fd406..72da5bf5002 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, &res->iov_cnt); - if (ret != 0 || res->iov) { + if (ret != 0) { cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; g_free(res); return;