From: Keir Fraser Date: Fri, 25 Jul 2008 08:47:41 +0000 (+0100) Subject: x86: adds put_domain() for breaks in arch_do_domctl(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14165^2~118 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=410dbc38e87a3d649746e7f8a0b6be963c5a16e1;p=xen.git x86: adds put_domain() for breaks in arch_do_domctl(). Signed-off-by: Weidong Han --- diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 52add55afa..8f1df3ed94 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -661,6 +661,7 @@ long arch_do_domctl( if ( !iommu_pv_enabled && !is_hvm_domain(d) ) { ret = -ENOSYS; + put_domain(d); break; } @@ -669,12 +670,16 @@ long arch_do_domctl( gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: " "%x:%x:%x already assigned, or non-existent\n", bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + put_domain(d); break; } ret = assign_device(d, bus, devfn); - gdprintk(XENLOG_INFO, "XEN_DOMCTL_assign_device: bdf = %x:%x:%x\n", - bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + if ( ret ) + gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: " + "assign device (%x:%x:%x) failed\n", + bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); + put_domain(d); } break; @@ -701,11 +706,15 @@ long arch_do_domctl( if ( !iommu_pv_enabled && !is_hvm_domain(d) ) { ret = -ENOSYS; + put_domain(d); break; } if ( !device_assigned(bus, devfn) ) + { + put_domain(d); break; + } ret = 0; deassign_device(d, bus, devfn);