Skip to content

Commit 906c232

Browse files
mcaylandvivier
authored andcommitted
macfb: fix invalid object reference in macfb_common_realize()
During realize memory_region_init_ram_nomigrate() is used to initialise the RAM memory region used for the framebuffer but the owner object reference is incorrect since MacFbState is a typedef and not a QOM type. Change the memory region owner to be the corresponding DeviceState to fix the issue and prevent random crashes during macfb_common_realize(). Signed-off-by: Mark Cave-Ayland <[email protected]> Fixes: 8ac919a ("hw/m68k: add Nubus macfb video card") Reviewed-by: BALATON Zoltan <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Laurent Vivier <[email protected]> Message-Id: <[email protected]> Signed-off-by: Laurent Vivier <[email protected]>
1 parent c047862 commit 906c232

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/display/macfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static bool macfb_common_realize(DeviceState *dev, MacfbState *s, Error **errp)
365365
memory_region_init_io(&s->mem_ctrl, OBJECT(dev), &macfb_ctrl_ops, s,
366366
"macfb-ctrl", 0x1000);
367367

368-
memory_region_init_ram_nomigrate(&s->mem_vram, OBJECT(s), "macfb-vram",
368+
memory_region_init_ram_nomigrate(&s->mem_vram, OBJECT(dev), "macfb-vram",
369369
MACFB_VRAM_SIZE, &error_abort);
370370
s->vram = memory_region_get_ram_ptr(&s->mem_vram);
371371
s->vram_bit_mask = MACFB_VRAM_SIZE - 1;

0 commit comments

Comments
 (0)