Skip to contentSkip to conversation

selinux:cleanup redundant code in selinux_init()

PATCH Paul Moore 1 participant 1 message May 20, 2014 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paul Moore

author maintainer NAK
#1 lore raw
Quoted 12 lines · zhangdianfang

Delete redundant if-condition code.

---
 security/selinux/hooks.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
security/selinux/hooks.c +0 -0
index 2c7341d..70afb3a 100644

security/selinux/hooks.c static __init int selinux_init(void) · line 5972

Quoted 10 lines
security/selinux/hooks.c +0 -4
@@ -5967,10 +5967,6 @@ static __init int selinux_init(void)
 {
 	if (!security_module_enable(&selinux_ops)) {
 		selinux_enabled = 0;
-		return 0;
-	}
-
-	if (!selinux_enabled) {
 		printk(KERN_INFO "SELinux:  Disabled at boot.\n");
 		return 0;
 	}

NACK

We still need to check selinux_enabled if security_module_enable() returns true.

Signature · 2 lines
paul moore
www.paul-moore.com