Re: [Qemu-devel] [PATCH] pci: cleanly backout of pci_qdev_init()

2010-05-11 Thread Alex Williamson
On Tue, 2010-05-11 at 21:17 +0300, Blue Swirl wrote: > On 5/10/10, Alex Williamson wrote: > > > > hw/pci.c | 17 - > > 1 files changed, 12 insertions(+), 5 deletions(-) > > > > diff --git a/hw/pci.c b/hw/pci.c > > index f167436..3d3560e 100644 > > --- a/hw/pci.c > > +++ b/

Re: [Qemu-devel] [PATCH] pci: cleanly backout of pci_qdev_init()

2010-05-11 Thread Blue Swirl
On 5/10/10, Alex Williamson wrote: > If the init function of a device fails, as might happen with device > assignment, we never undo the work done by do_pci_register_device(). > This not only causes a bit of a memory leak, but also leaves a bogus > pointer in the bus devices array that can caus

Re: [Qemu-devel] [PATCH] pci: cleanly backout of pci_qdev_init()

2010-05-11 Thread Gerd Hoffmann
On 05/11/10 11:25, Markus Armbruster wrote: Alex Williamson writes: If the init function of a device fails, as might happen with device assignment, we never undo the work done by do_pci_register_device(). This not only causes a bit of a memory leak, but also leaves a bogus pointer in the bus d

Re: [Qemu-devel] [PATCH] pci: cleanly backout of pci_qdev_init()

2010-05-11 Thread Markus Armbruster
Alex Williamson writes: > If the init function of a device fails, as might happen with device > assignment, we never undo the work done by do_pci_register_device(). > This not only causes a bit of a memory leak, but also leaves a bogus > pointer in the bus devices array that can cause a segfault

[Qemu-devel] [PATCH] pci: cleanly backout of pci_qdev_init()

2010-05-10 Thread Alex Williamson
If the init function of a device fails, as might happen with device assignment, we never undo the work done by do_pci_register_device(). This not only causes a bit of a memory leak, but also leaves a bogus pointer in the bus devices array that can cause a segfault or garbage data from 'info pci'.