projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9623e5a
)
CRED: Fix memory leak in error handling
author
Mathieu Desnoyers
<
[email protected]
>
Mon, 29 Mar 2010 23:04:00 +0000
(
00:04
+0100)
committer
James Morris
<
[email protected]
>
Tue, 30 Mar 2010 06:15:38 +0000
(17:15 +1100)
Fix a memory leak on an OOM condition in prepare_usermodehelper_creds().
Signed-off-by: Mathieu Desnoyers <
[email protected]
>
Signed-off-by: David Howells <
[email protected]
>
Signed-off-by: James Morris <
[email protected]
>
kernel/cred.c
patch
|
blob
|
history
diff --git
a/kernel/cred.c
b/kernel/cred.c
index 1ed8ca18790c1e937208af47bed6695f4218858b..1b1129d0cce87077055704c78d4ae364d8fb4cc8 100644
(file)
--- a/
kernel/cred.c
+++ b/
kernel/cred.c
@@
-364,7
+364,7
@@
struct cred *prepare_usermodehelper_creds(void)
new = kmem_cache_alloc(cred_jar, GFP_ATOMIC);
if (!new)
-
return NULL
;
+
goto free_tgcred
;
kdebug("prepare_usermodehelper_creds() alloc %p", new);
@@
-397,6
+397,10
@@
struct cred *prepare_usermodehelper_creds(void)
error:
put_cred(new);
+free_tgcred:
+#ifdef CONFIG_KEYS
+ kfree(tgcred);
+#endif
return NULL;
}