From 7a01a1bf65c9eaf4e091194bcf51fb1be693c0b4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Feb 2009 10:34:50 +0000 Subject: [PATCH] fix error recovery in pass-through.c return NULL when error. fix error recovery path. Signed-off-by: Isaku Yamahata --- hw/pass-through.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/pass-through.c b/hw/pass-through.c index 29714c7ee..c2a6ec102 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -3736,8 +3736,10 @@ struct pt_dev * register_real_device(PCIBus *e_bus, free_pci_slot = __insert_to_pci_slot(r_bus, r_dev, r_func, 0, NULL); if ( free_pci_slot > 0 ) e_devfn = free_pci_slot << 3; - else + else { PT_LOG("Error: no free virtual PCI hot plug slot, thus no live migration.\n"); + return NULL; + } } msi_translate = direct_pci_msitranslate; -- 2.39.5