Skip to content

Commit

Permalink
tomoyo: use DEFINE_SRCU() to define tomoyo_ss
Browse files Browse the repository at this point in the history
DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <[email protected]>
Acked-by: Tetsuo Handa <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
Lai Jiangshan authored and James Morris committed Mar 18, 2013
1 parent 2c4cdf5 commit 921f3ac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions security/tomoyo/tomoyo.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static struct security_operations tomoyo_security_ops = {
};

/* Lock for GC. */
struct srcu_struct tomoyo_ss;
DEFINE_SRCU(tomoyo_ss);

/**
* tomoyo_init - Register TOMOYO Linux as a LSM module.
Expand All @@ -550,8 +550,7 @@ static int __init tomoyo_init(void)
if (!security_module_enable(&tomoyo_security_ops))
return 0;
/* register ourselves with the security framework */
if (register_security(&tomoyo_security_ops) ||
init_srcu_struct(&tomoyo_ss))
if (register_security(&tomoyo_security_ops))
panic("Failure registering TOMOYO Linux");
printk(KERN_INFO "TOMOYO Linux initialized\n");
cred->security = &tomoyo_kernel_domain;
Expand Down

0 comments on commit 921f3ac

Please sign in to comment.