aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDongwon Kim <dongwon.kim@intel.com>2023-06-26 17:34:53 -0700
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-06-27 17:08:56 +0200
commit7b41ca8d913cdd91d33d74d906dd5d7bd9f41045 (patch)
tree58e7a798eb9fe1aa0775bfddbe2a8a909a326938 /hw
parent37802a24eb4e535d96d6fe0273505d2b5c6528c2 (diff)
downloadqemu-7b41ca8d913cdd91d33d74d906dd5d7bd9f41045.zip
qemu-7b41ca8d913cdd91d33d74d906dd5d7bd9f41045.tar.gz
qemu-7b41ca8d913cdd91d33d74d906dd5d7bd9f41045.tar.bz2
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 <kraxel@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20230627003453.5321-1-dongwon.kim@intel.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/display/virtio-gpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 506cda9..1f8a5b1 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;