mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-08-26 22:23:12 -04:00
hw/display/virtio-gpu: Avoid mmap() for empty blob
Calling mmap() for an empty blob fails with EINVAL, causing QEMU to
emit a spurious warning.
Fixes: e0933d91b1 ("virtio-gpu: Add virtio_gpu_resource_create_blob")
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260825-dmabuf-v2-2-b3d64d3b9a0e@rsg.ci.i.u-tokyo.ac.jp>
This commit is contained in:
parent
14f2511f59
commit
3f163489c6
1 changed files with 1 additions and 1 deletions
|
|
@ -139,7 +139,7 @@ void virtio_gpu_init_udmabuf(struct virtio_gpu_simple_resource *res)
|
|||
if (res->iov_cnt == 1 &&
|
||||
res->iov[0].iov_len < 4096) {
|
||||
pdata = res->iov[0].iov_base;
|
||||
} else {
|
||||
} else if (res->blob_size) {
|
||||
virtio_gpu_create_udmabuf(res);
|
||||
if (res->dmabuf_fd < 0) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue