From: Chris Wright Date: Fri, 22 Oct 2004 01:15:52 +0000 (-0700) Subject: [PATCH] lsm: reduce noise during security_register X-Git-Tag: v2.6.10-rc1~9 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6ba4eba6be1fc63002ce883cc42733139a24946a;p=history.git [PATCH] lsm: reduce noise during security_register 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 Signed-off-by: Linus Torvalds --- diff --git a/security/security.c b/security/security.c index 890b678acecc..1aee1805509b 100644 --- a/security/security.c +++ b/security/security.c @@ -29,11 +29,8 @@ struct security_operations *security_ops; /* Initialized to NULL */ 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;