[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 <vsu@altlinux.ru> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
b5a7c4f583
commit
6a4d11c2ab
|
@ -140,6 +140,7 @@ __set_personality(u_long personality)
|
||||||
ep = lookup_exec_domain(personality);
|
ep = lookup_exec_domain(personality);
|
||||||
if (ep == current_thread_info()->exec_domain) {
|
if (ep == current_thread_info()->exec_domain) {
|
||||||
current->personality = personality;
|
current->personality = personality;
|
||||||
|
module_put(ep->module);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue