On 27/1/26 13:24, [email protected] wrote:
From: Marc-André Lureau <[email protected]>
When virtio_gpu_rutabaga_get_num_capsets() returns 0, virtio_init()
isn't called and the device later crashes during realize.
==72545==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc
0x556ad6f7ba9e bp 0x7ffe6958f810 sp 0x7ffe6958f7e0 T0)
==72545==The signal is caused by a READ memory access.
==72545==Hint: address points to the zero page.
#0 0x556ad6f7ba9e in virtio_memory_listener_commit ../hw/virtio/virtio.c:4034
#1 0x556ad6a24c96 in listener_add_address_space ../system/memory.c:3128
#2 0x556ad6a25d15 in memory_listener_register ../system/memory.c:3216
#3 0x556ad6f7bf11 in virtio_device_realize ../hw/virtio/virtio.c:4075
Rework error handling of the function to set Error appropriately. 0
capset may be ok now.
Signed-off-by: Marc-André Lureau <[email protected]>
---
hw/display/virtio-gpu-rutabaga.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>