Skip to contentSkip to conversation

common/memory: fix an XSM error path

PATCH In review Jan Beulich 3 participants 3 messages Jan 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/memory: fix an XSM error path

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap return the extent at which failure was detected, not error indicators.

xen/common/memory.c +2 -3
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )

common/memory: fix an XSM error path

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap return the extent at which failure was detected, not error indicators.

xen/common/memory.c +2 -3
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jan Beulich

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap return the extent at which failure was detected, not error indicators.

Quoted 22 lines
xen/common/memory.c +2 -3
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 4 lines · Jan Beulich

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap return the extent at which failure was detected, not error indicators.

(though I don't think my ack is technically required here)

Quoted 19 lines
xen/common/memory.c +2 -3
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
              return start_extent;
          args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
          {
              rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
          }
 
          switch ( op )
Signature · 2 lines
Daniel De Graaf
National Security Agency