[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] hw: do not pass NULL to memory_region_init
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] hw: do not pass NULL to memory_region_init from instance_init |
Date: |
Tue, 29 Sep 2015 13:42:49 +0100 |
On 29 September 2015 at 13:37, Paolo Bonzini <address@hidden> wrote:
> This causes the region to outlive the object, because it attaches the
> region to /machine. This is not nice for the "realize" method, but
> much worse for "instance_init" because it can cause dangling pointers
> after a simple object_new/object_unref pair.
>
> Reported-by: Markus Armbruster <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> hw/arm/pxa2xx.c | 2 +-
> hw/display/cg3.c | 4 ++--
> hw/display/tcx.c | 2 +-
> hw/misc/arm_integrator_debug.c | 2 +-
> hw/misc/macio/cuda.c | 2 +-
> hw/misc/macio/macio.c | 6 +++---
> 6 files changed, 9 insertions(+), 9 deletions(-)
Some of the macio changes are realize function code rather than
instance_init, but they're all bugs either way.
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
Re: [Qemu-devel] [PATCH 2/3] hw: do not pass NULL to memory_region_init from instance_init, Markus Armbruster, 2015/10/08