virtio-gpu: fix unmap in error path
commita7f85e03b94ffaca75332cddf06426fc85ac611a
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 28 Jun 2019 07:23:57 +0000 (28 09:23 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 3 Jul 2019 06:57:09 +0000 (3 08:57 +0200)
tree74ba1f18eebadd92f7f39b9c43ec8efffab0c269
parent506179e42112be77bfd071f050b15762d3b2cd43
virtio-gpu: fix unmap in error path

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 <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20190628072357.31782-1-kraxel@redhat.com
hw/display/virtio-gpu.c