ima: ima_initialized is set only if successful
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Mon, 25 Jun 2012 09:18:11 +0000 (12:18 +0300)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 5 Jul 2012 20:43:57 +0000 (16:43 -0400)
Set ima_initialized only if initialization was successful.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_main.c

index 5b0548d..be82949 100644 (file)
@@ -258,7 +258,8 @@ static int __init init_ima(void)
        int error;
 
        error = ima_init();
-       ima_initialized = 1;
+       if (!error)
+               ima_initialized = 1;
        return error;
 }