* [PATCH] cred fix error handling
@ 2010-03-29 14:05 Mathieu Desnoyers
0 siblings, 0 replies; only message in thread
From: Mathieu Desnoyers @ 2010-03-29 14:05 UTC (permalink / raw)
To: David Howells; +Cc: linux-kernel
Causes memory leak on OO mem condition.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: David Howells <dhowells@redhat.com>
---
kernel/cred.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Index: linux.trees.git/kernel/cred.c
===================================================================
--- linux.trees.git.orig/kernel/cred.c 2010-03-29 09:40:53.000000000 -0400
+++ linux.trees.git/kernel/cred.c 2010-03-29 10:03:15.000000000 -0400
@@ -364,7 +364,7 @@ struct cred *prepare_usermodehelper_cred
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_cred
error:
put_cred(new);
+free_tgcred:
+#ifdef CONFIG_KEYS
+ kfree(tgcred);
+#endif
return NULL;
}
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-03-29 14:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 14:05 [PATCH] cred fix error handling Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®