[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [PULL 1/4] virtio-gpu: fix unmap in error path

From: Gerd Hoffmann
Subject: [Qemu-arm] [PULL 1/4] virtio-gpu: fix unmap in error path
Date: Wed, 3 Jul 2019 10:54:13 +0200

We land here in case not everything we've asked for could be mapped.
So unmap only the bytes which have actually been mapped.

Also we didn't access anything, so acces_len can be 0.

Reported-by: Laszlo Ersek <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Li Qiang <address@hidden>
Message-id: address@hidden
 hw/display/virtio-gpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 2b0f66b1d68d..475a018c027c 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1048,9 +1048,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, 
size_t size,
                 if (res->iov[i].iov_base) {
-                                     res->iov[i].iov_len,
+                                     len,
-                                     res->iov[i].iov_len);
+                                     0);
                 /* ...and the mappings for previous loop iterations */
                 res->iov_cnt = i;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]