Skip to content

Commit

Permalink
hw/display/qxl: Assert memory slot fits in preallocated MemoryRegion
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20221128202741.4945-6-philmd@linaro.org>
  • Loading branch information
philmd authored and stefanhaRH committed Nov 29, 2022
1 parent dcc6cef commit d8f82b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/display/qxl.c
Expand Up @@ -1384,6 +1384,7 @@ static int qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
qxl_set_guest_bug(d, "%s: pci_region = %d", __func__, pci_region);
return 1;
}
assert(guest_end - pci_start <= memory_region_size(mr));

virt_start = (intptr_t)memory_region_get_ram_ptr(mr);
memslot.slot_id = slot_id;
Expand Down

0 comments on commit d8f82b5

Please sign in to comment.