From: Dongwon Kim Date: Tue, 27 Jun 2023 00:34:53 +0000 (-0700) Subject: virtio-gpu: OUT_OF_MEMORY if failing to create udmabuf X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7b41ca8d913cdd91d33d74d906dd5d7bd9f41045;p=qemu.git virtio-gpu: OUT_OF_MEMORY if failing to create udmabuf Respond with VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY if it fails to create an udmabuf for the blob resource. v2: consolidated return statments and removed an unnecessary style change Cc: Gerd Hoffmann Cc: Marc-André Lureau Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim Reviewed-by: Marc-André Lureau Message-ID: <20230627003453.5321-1-dongwon.kim@intel.com> --- diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 506cda944d..1f8a5b16c6 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -651,8 +651,10 @@ static void virtio_gpu_do_set_scanout(VirtIOGPU *g, if (console_has_gl(scanout->con)) { if (!virtio_gpu_update_dmabuf(g, scanout_id, res, fb, r)) { virtio_gpu_update_scanout(g, scanout_id, res, r); - return; + } else { + *error = VIRTIO_GPU_RESP_ERR_OUT_OF_MEMORY; } + return; } data = res->blob;