evm: fix evm_inode_init_security return code
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 11 Aug 2011 04:22:52 +0000 (00:22 -0400)
committerJames Morris <jmorris@namei.org>
Thu, 11 Aug 2011 07:42:41 +0000 (17:42 +1000)
evm_inode_init_security() should return 0, when EVM is not enabled.
(Returning an error is a remnant of evm_inode_post_init_security.)

Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
include/linux/evm.h
security/integrity/evm/evm_main.c

index 62deb6557d37f4beb5052933b0c48f65f413809d..ea603c9e775df3426b28afc4ca3c76f726914ce0 100644 (file)
@@ -85,7 +85,7 @@ static inline int evm_inode_init_security(struct inode *inode,
                                          const struct xattr *xattr_array,
                                          struct xattr *evm)
 {
-       return -EOPNOTSUPP;
+       return 0;
 }
 
 #endif /* CONFIG_EVM_H */
index 8fc5b5d7ceaaa77097b0cf5f14a86880ba0961c3..f0127e536f849ad7bee146d3b350ba8d0ead4dc0 100644 (file)
@@ -324,7 +324,7 @@ int evm_inode_init_security(struct inode *inode,
        int rc;
 
        if (!evm_initialized || !evm_protected_xattr(lsm_xattr->name))
-               return -EOPNOTSUPP;
+               return 0;
 
        xattr_data = kzalloc(sizeof(*xattr_data), GFP_NOFS);
        if (!xattr_data)