aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-07-25 09:47:41 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-07-25 09:47:41 +0100
commit410dbc38e87a3d649746e7f8a0b6be963c5a16e1 (patch)
tree07489cfcc72021e7f4a68b3ee8d15c88ca2fd2d7
parent4ae5a5219287631e2b7bb804944b96088cbf7ca3 (diff)
downloadxen-410dbc38e87a3d649746e7f8a0b6be963c5a16e1.tar.gz
xen-410dbc38e87a3d649746e7f8a0b6be963c5a16e1.tar.bz2
xen-410dbc38e87a3d649746e7f8a0b6be963c5a16e1.zip
x86: adds put_domain() for breaks in arch_do_domctl().
Signed-off-by: Weidong Han <weidong.han@intel.com>
-rw-r--r--xen/arch/x86/domctl.c13
1 files changed, 11 insertions, 2 deletions
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);