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

[Xen-devel] [PATCH 4/4] xsm: streamline xsm_default_action()



The privileges being strongly ordered is better reflected by using fall
through within the respective switch statement.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -59,20 +59,14 @@ static always_inline int xsm_default_act
     switch ( action ) {
     case XSM_HOOK:
         return 0;
-    case XSM_DM_PRIV:
-        if ( src->is_privileged )
-            return 0;
-        if ( target && src->target == target )
-            return 0;
-        return -EPERM;
     case XSM_TARGET:
         if ( src == target )
             return 0;
-        if ( src->is_privileged )
-            return 0;
+        /* fall through */
+    case XSM_DM_PRIV:
         if ( target && src->target == target )
             return 0;
-        return -EPERM;
+        /* fall through */
     case XSM_PRIV:
         if ( src->is_privileged )
             return 0;



Attachment: xsm-default-action-fallthrough.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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