WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] domctl: Fix the wrong return values when

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] domctl: Fix the wrong return values when xsm_xxx() returns 0
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Sep 2008 08:00:14 -0700
Delivery-date: Tue, 30 Sep 2008 08:00:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] domctl: Fix the wrong return values when xsm_xxx() returns 0, Xen patchbot-unstable <=