From 6a4d11c2abc57ed7ca42041e5f68ae4f7f640a81 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Fri, 24 Mar 2006 03:18:38 -0800 Subject: [PATCH] Fix module refcount leak in __set_personality() If the change of personality does not lead to change of exec domain, __set_personality() returned without releasing the module reference acquired by lookup_exec_domain(). Signed-off-by: Sergey Vlasov Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/exec_domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 867d6dbeb574..c01cead2cfd6 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c @@ -140,6 +140,7 @@ __set_personality(u_long personality) ep = lookup_exec_domain(personality); if (ep == current_thread_info()->exec_domain) { current->personality = personality; + module_put(ep->module); return 0; } -- cgit v1.2.3