[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] domctl: Fix the wrong return values when xsm_xxx() returns 0



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222677785 -3600
# Node ID 2e7f5c177495fd8dc21c6af1e20df9a9c2d28972
# Parent  6871f484430c18f0b521712d182f4d68fbb59874
domctl: Fix the wrong return values when xsm_xxx() returns 0

In 18423: 44f039c4aee4,  if xsm_xxx() returns 0, there are some places
where the return value would be incorrect. The patch fixes them.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 xen/arch/x86/domctl.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r 6871f484430c -r 2e7f5c177495 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Sun Sep 28 16:53:14 2008 +0100
+++ b/xen/arch/x86/domctl.c     Mon Sep 29 09:43:05 2008 +0100
@@ -620,13 +620,13 @@ long arch_do_domctl(
         if ( !iommu_enabled )
             break;
 
+        ret = xsm_test_assign_device(domctl->u.assign_device.machine_bdf);
+        if ( ret )
+            break;
+
         ret = -EINVAL;
         bus = (domctl->u.assign_device.machine_bdf >> 16) & 0xff;
         devfn = (domctl->u.assign_device.machine_bdf >> 8) & 0xff;
-
-        ret = xsm_test_assign_device(domctl->u.assign_device.machine_bdf);
-        if ( ret )
-            break;
 
         if ( device_assigned(bus, devfn) )
         {
@@ -670,6 +670,7 @@ long arch_do_domctl(
             break;
         }
 
+        ret = -EINVAL;
         if ( device_assigned(bus, devfn) )
         {
             gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: "
@@ -751,6 +752,7 @@ long arch_do_domctl(
         if ( ret )
             goto bind_out;
 
+        ret = -ESRCH;
         if ( iommu_enabled )
             ret = pt_irq_create_bind_vtd(d, bind);
         if ( ret < 0 )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.