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

2010-05-11 Thread Markus Armbruster
Alex Williamson alex.william...@redhat.com 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

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 Williamsonalex.william...@redhat.com 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

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

2010-05-11 Thread Blue Swirl
On 5/10/10, Alex Williamson alex.william...@redhat.com 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

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 alex.william...@redhat.com 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

[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'.