All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, Mark McLoughlin <markmc@redhat.com>
Subject: [PATCH 04/12] kvm: qemu: device-assignment: unregister device if assignment fails
Date: Fri, 28 Nov 2008 17:10:42 +0000	[thread overview]
Message-ID: <1227892250-14386-4-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <1227892250-14386-3-git-send-email-markmc@redhat.com>

Fixes a segfault in assigned_dev_update_irq() if assigning a device
previously failed.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 qemu/hw/device-assignment.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 8fbd66c..b5cf6ee 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -550,8 +550,11 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus)
     }
 
     adev->assigned_dev = dev;
-  out:
     return &dev->dev;
+
+out:
+    pci_unregister_device(&dev->dev);
+    return NULL;
 }
 
 /*
-- 
1.5.4.3


  reply	other threads:[~2008-11-28 17:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 17:10 [PATCH 01/12] kvm: qemu: device-assignment: add_assigned_device() returns a pointer Mark McLoughlin
2008-11-28 17:10 ` [PATCH 02/12] kvm: qemu: device-assignment: introduce add_assigned_devices() Mark McLoughlin
2008-11-28 17:10   ` [PATCH 03/12] kvm: qemu: device-assignment: exit if cmdline parsing fails Mark McLoughlin
2008-11-28 17:10     ` Mark McLoughlin [this message]
2008-11-28 17:10       ` [PATCH 05/12] kvm: qemu: device-assignment: fixup error reporting Mark McLoughlin
2008-11-28 17:10         ` [PATCH 06/12] kvm: qemu: device-assignment: cleanup irq assignment error messages Mark McLoughlin
2008-11-28 17:10           ` [PATCH 07/12] kvm: qemu: device-assignment: remove device if irq assignment fails Mark McLoughlin
2008-11-28 17:10             ` [PATCH 08/12] kvm: qemu: device-assignment: introduce free_assigned_device() Mark McLoughlin
2008-11-28 17:10               ` [PATCH 09/12] kvm: qemu: device-assignment: free device if hotplug fails Mark McLoughlin
2008-11-28 17:10                 ` [PATCH 10/12] kvm: qemu: device-assignment: close PCIDevRegions::config_fd Mark McLoughlin
2008-11-28 17:10                   ` [PATCH 11/12] kvm: qemu: device-assignment: munmap() mmio regions Mark McLoughlin
2008-11-28 17:10                     ` [PATCH 12/12] kvm: qemu: device-assignment: init_assigned_device() error handling Mark McLoughlin
2008-11-28 19:05           ` [PATCH 06/12] kvm: qemu: device-assignment: cleanup irq assignment error messages John Rousseau
2008-11-30 10:47             ` Avi Kivity
2008-12-10 10:23     ` [PATCH] kvm: qemu: device-assignment: really exit if cmdline parsing fails Mark McLoughlin
2008-12-10 10:28       ` Avi Kivity
2008-11-28 17:14 ` [PATCH 01/12] kvm: qemu: device-assignment: add_assigned_device() returns a pointer Mark McLoughlin
2008-11-30 10:42   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1227892250-14386-4-git-send-email-markmc@redhat.com \
    --to=markmc@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.