aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/realpath.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2009-02-21 20:40:50 +0900
committerJames Morris <jmorris@namei.org>2009-02-23 09:45:05 +1100
commit1581e7ddbdd97443a134e1a0cc9d81256baf77a4 (patch)
tree54134783d9b61dea08b434e0d6e447ac8f8924b2 /security/tomoyo/realpath.c
parentintegrity: ima scatterlist bug fix (diff)
downloadlinux-dev-1581e7ddbdd97443a134e1a0cc9d81256baf77a4.tar.xz
linux-dev-1581e7ddbdd97443a134e1a0cc9d81256baf77a4.zip
TOMOYO: Do not call tomoyo_realpath_init unless registered.
tomoyo_realpath_init() is unconditionally called by security_initcall(). But nobody will use realpath related functions if TOMOYO is not registered. So, let tomoyo_init() call tomoyo_realpath_init(). This patch saves 4KB of memory allocation if TOMOYO is not registered. Signed-off-by: Kentaro Takeda <takedakn@nttdata.co.jp> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Toshiharu Harada <haradats@nttdata.co.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/realpath.c')
-rw-r--r--security/tomoyo/realpath.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
index 5fd48d23a217..d47f16b844b2 100644
--- a/security/tomoyo/realpath.c
+++ b/security/tomoyo/realpath.c
@@ -371,10 +371,8 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name)
/**
* tomoyo_realpath_init - Initialize realpath related code.
- *
- * Returns 0.
*/
-static int __init tomoyo_realpath_init(void)
+void __init tomoyo_realpath_init(void)
{
int i;
@@ -388,11 +386,8 @@ static int __init tomoyo_realpath_init(void)
if (tomoyo_find_domain(TOMOYO_ROOT_NAME) != &tomoyo_kernel_domain)
panic("Can't register tomoyo_kernel_domain");
up_read(&tomoyo_domain_list_lock);
- return 0;
}
-security_initcall(tomoyo_realpath_init);
-
/* Memory allocated for temporary purpose. */
static atomic_t tomoyo_dynamic_memory_size;