flask: fix error propagation from flask_security_set_bool()
authorJan Beulich <jbeulich@suse.com>
Tue, 11 Feb 2014 10:13:22 +0000 (11:13 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Feb 2014 10:13:22 +0000 (11:13 +0100)
The function should return an error when flask_security_make_bools()
fails as well as when the input ID is out of range.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xen/xsm/flask/flask_op.c

index e4b07eb04ee4734fe33642a359baea272bfdf937..cde93084c96e11d076237e4ac758953c122a4da2 100644 (file)
@@ -364,9 +364,10 @@ static int flask_security_set_bool(struct xen_flask_boolean *arg)
     else
     {
         if ( !bool_pending_values )
-            flask_security_make_bools();
-
-        if ( arg->bool_id >= bool_num )
+            rv = flask_security_make_bools();
+        if ( !rv && arg->bool_id >= bool_num )
+            rv = -ENOENT;
+        if ( rv )
             goto out;
 
         bool_pending_values[arg->bool_id] = !!(arg->new_value);