
From: Chris Wright <chrisw@osdl.org>

Registering a security module can be a noisy operation, esp.  when it
retries registration with the primary module.  Eliminate some noise, and
distinguish the return values for register_security so a module can tell
the difference between failure modes.

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/security/security.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff -puN security/security.c~lsm-reduce-noise-during-security_register security/security.c
--- 25/security/security.c~lsm-reduce-noise-during-security_register	2004-10-21 21:24:13.304560176 -0700
+++ 25-akpm/security/security.c	2004-10-21 21:24:13.308559568 -0700
@@ -29,11 +29,8 @@ struct security_operations *security_ops
 static inline int verify (struct security_operations *ops)
 {
 	/* verify the security_operations structure exists */
-	if (!ops) {
-		printk (KERN_INFO "Passed a NULL security_operations "
-			"pointer, %s failed.\n", __FUNCTION__);
+	if (!ops)
 		return -EINVAL;
-	}
 	security_fixup_ops (ops);
 	return 0;
 }
@@ -85,16 +82,13 @@ int __init security_init(void)
 int register_security (struct security_operations *ops)
 {
 	if (verify (ops)) {
-		printk (KERN_INFO "%s could not verify "
+		printk(KERN_DEBUG "%s could not verify "
 			"security_operations structure.\n", __FUNCTION__);
 		return -EINVAL;
 	}
 
-	if (security_ops != &dummy_security_ops) {
-		printk (KERN_INFO "There is already a security "
-			"framework initialized, %s failed.\n", __FUNCTION__);
-		return -EINVAL;
-	}
+	if (security_ops != &dummy_security_ops)
+		return -EAGAIN;
 
 	security_ops = ops;
 
_
